This repository has been archived by the owner on Jun 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 55
/
name.go
54 lines (45 loc) · 1.74 KB
/
name.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package iface
import (
"context"
"errors"
path "github.com/ipfs/interface-go-ipfs-core/path"
"github.com/ipfs/interface-go-ipfs-core/options"
)
// Deprecated: use github.com/ipfs/boxo/coreiface.ErrResolveFailed
var ErrResolveFailed = errors.New("could not resolve name")
// IpnsEntry specifies the interface to IpnsEntries
//
// Deprecated: use github.com/ipfs/boxo/coreiface.IpnsEntry
type IpnsEntry interface {
// Name returns IpnsEntry name
Name() string
// Value returns IpnsEntry value
Value() path.Path
}
// Deprecated: use github.com/ipfs/boxo/coreiface.IpnsResult
type IpnsResult struct {
path.Path
Err error
}
// NameAPI specifies the interface to IPNS.
//
// IPNS is a PKI namespace, where names are the hashes of public keys, and the
// private key enables publishing new (signed) values. In both publish and
// resolve, the default name used is the node's own PeerID, which is the hash of
// its public key.
//
// You can use .Key API to list and generate more names and their respective keys.
//
// Deprecated: use github.com/ipfs/boxo/coreiface.NameAPI
type NameAPI interface {
// Publish announces new IPNS name
Publish(ctx context.Context, path path.Path, opts ...options.NamePublishOption) (IpnsEntry, error)
// Resolve attempts to resolve the newest version of the specified name
Resolve(ctx context.Context, name string, opts ...options.NameResolveOption) (path.Path, error)
// Search is a version of Resolve which outputs paths as they are discovered,
// reducing the time to first entry
//
// Note: by default, all paths read from the channel are considered unsafe,
// except the latest (last path in channel read buffer).
Search(ctx context.Context, name string, opts ...options.NameResolveOption) (<-chan IpnsResult, error)
}