Documentation ¶
Overview ¶
package namesys implements various functionality for the ipns naming system.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrExpiredRecord = errors.New("expired record")
ErrExpiredRecord should be returned when an ipns record is invalid due to being too old
var ErrPublishFailed = errors.New("could not publish name.")
ErrPublishFailed signals an error when attempting to publish.
var ErrResolveFailed = errors.New("could not resolve name.")
ErrResolveFailed signals an error when attempting to resolve.
var ErrUnrecognizedValidity = errors.New("unrecognized validity type")
ErrUnrecognizedValidity is returned when an IpnsRecord has an unknown validity type.
var IpnsRecordValidator = &record.ValidChecker{ Func: ValidateIpnsRecord, Sign: true, }
Functions ¶
Types ¶
type DNSResolver ¶
type DNSResolver struct { }
DNSResolver implements a Resolver on DNS domains
func (*DNSResolver) CanResolve ¶ added in v0.2.2
func (r *DNSResolver) CanResolve(name string) bool
CanResolve implements Resolver
type NameSystem ¶
Namesys represents a cohesive name publishing and resolving system.
Publishing a name is the process of establishing a mapping, a key-value pair, according to naming rules and databases.
Resolving a name is the process of looking up the value associated with the key (name).
func NewNameSystem ¶
func NewNameSystem(r routing.IpfsRouting) NameSystem
NewNameSystem will construct the IPFS naming system based on Routing
type ProquintResolver ¶
type ProquintResolver struct{}
func (*ProquintResolver) CanResolve ¶ added in v0.2.2
func (r *ProquintResolver) CanResolve(name string) bool
CanResolve implements Resolver. Checks whether the name is a proquint string.
type Publisher ¶
type Publisher interface { // Publish establishes a name-value mapping. // TODO make this not PrivKey specific. Publish(ctx context.Context, name ci.PrivKey, value u.Key) error }
Publisher is an object capable of publishing particular names.
func NewRoutingPublisher ¶ added in v0.2.2
func NewRoutingPublisher(route routing.IpfsRouting) Publisher
NewRoutingPublisher constructs a publisher for the IPFS Routing name system.
type Resolver ¶
type Resolver interface { // Resolve looks up a name, and returns the value previously published. Resolve(ctx context.Context, name string) (value u.Key, err error) // CanResolve checks whether this Resolver can resolve a name CanResolve(name string) bool }
Resolver is an object capable of resolving names.
func NewRoutingResolver ¶ added in v0.2.2
func NewRoutingResolver(route routing.IpfsRouting) Resolver
NewRoutingResolver constructs a name resolver using the IPFS Routing system to implement SFS-like naming on top.