docs for coreapi name method impls
License: MIT Signed-off-by: ForrestWeston <forrest@protocol.ai>
ForrestWeston committed
Jan 22, 2018 at 14:46 UTC
600bd08a72437b4698b84734198ac39e0668eb8e
1 file changed
+5
core/coreapi/name.go
+5
@@ -29,14 +29,17 @@ type ipnsEntry struct {
29
value coreiface.Path
30
}
31
32
+// Name returns the ipnsEntry name.
33
func (e *ipnsEntry) Name() string {
34
return e.name
35
}
36
37
+// Value returns the ipnsEntry value.
38
func (e *ipnsEntry) Value() coreiface.Path {
39
return e.value
40
}
41
42
+// Publish announces new IPNS name and returns the new IPNS entry.
43
func (api *NameAPI) Publish(ctx context.Context, p coreiface.Path, opts ...caopts.NamePublishOption) (coreiface.IpnsEntry, error) {
44
options, err := caopts.NamePublishOptions(opts...)
45
if err != nil {
@@ -82,6 +85,8 @@ func (api *NameAPI) Publish(ctx context.Context, p coreiface.Path, opts ...caopt
85
}, nil
86
}
87
88
+// Resolve attempts to resolve the newest version of the specified name and
89
+// returns its path.
90
func (api *NameAPI) Resolve(ctx context.Context, name string, opts ...caopts.NameResolveOption) (coreiface.Path, error) {
91
options, err := caopts.NameResolveOptions(opts...)
92
if err != nil {