1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-08-06 19:44:01 +08:00

docs for coreapi name method impls

License: MIT
Signed-off-by: ForrestWeston <forrest@protocol.ai>
This commit is contained in:
ForrestWeston
2018-01-22 14:46:04 -08:00
parent 252ddc8295
commit 600bd08a72

View File

@ -29,14 +29,17 @@ type ipnsEntry struct {
value coreiface.Path
}
// Name returns the ipnsEntry name.
func (e *ipnsEntry) Name() string {
return e.name
}
// Value returns the ipnsEntry value.
func (e *ipnsEntry) Value() coreiface.Path {
return e.value
}
// Publish announces new IPNS name and returns the new IPNS entry.
func (api *NameAPI) Publish(ctx context.Context, p coreiface.Path, opts ...caopts.NamePublishOption) (coreiface.IpnsEntry, error) {
options, err := caopts.NamePublishOptions(opts...)
if err != nil {
@ -82,6 +85,8 @@ func (api *NameAPI) Publish(ctx context.Context, p coreiface.Path, opts ...caopt
}, nil
}
// Resolve attempts to resolve the newest version of the specified name and
// returns its path.
func (api *NameAPI) Resolve(ctx context.Context, name string, opts ...caopts.NameResolveOption) (coreiface.Path, error) {
options, err := caopts.NameResolveOptions(opts...)
if err != nil {