namesys

package
v0.0.0-...-e4696f9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2014 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrExpiredRecord = errors.New("expired record")

ErrExpiredRecord should be returned when an ipns record is invalid due to being too old

View Source
var ErrPublishFailed = errors.New("could not publish name.")

ErrPublishFailed signals an error when attempting to publish.

View Source
var ErrResolveFailed = errors.New("could not resolve name.")

ErrResolveFailed signals an error when attempting to resolve.

View Source
var ErrUnrecognizedValidity = errors.New("unrecognized validity type")

ErrUnrecognizedValidity is returned when an IpnsRecord has an unknown validity type.

Functions

func ValidateIpnsRecord

func ValidateIpnsRecord(k u.Key, val []byte) error

ValidateIpnsRecord implements ValidatorFunc and verifies that the given 'val' is an IpnsEntry and that that entry is valid.

Types

type DNSResolver

type DNSResolver struct {
}

DNSResolver implements a Resolver on DNS domains

func (*DNSResolver) CanResolve

func (r *DNSResolver) CanResolve(name string) bool

CanResolve implements Resolver

func (*DNSResolver) Resolve

func (r *DNSResolver) Resolve(name string) (string, error)

Resolve implements Resolver TXT records for a given domain name should contain a b58 encoded multihash.

type NameSystem

type NameSystem interface {
	Resolver
	Publisher
}

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

func (r *ProquintResolver) CanResolve(name string) bool

CanResolve implements Resolver. Checks whether the name is a proquint string.

func (*ProquintResolver) Resolve

func (r *ProquintResolver) Resolve(name string) (string, error)

Resolve implements Resolver. Decodes the proquint string.

type Publisher

type Publisher interface {

	// Publish establishes a name-value mapping.
	// TODO make this not PrivKey specific.
	Publish(name ci.PrivKey, value string) error
}

Publisher is an object capable of publishing particular names.

func NewRoutingPublisher

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(name string) (value string, 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

func NewRoutingResolver(route routing.IpfsRouting) Resolver

NewRoutingResolver constructs a name resolver using the IPFS Routing system to implement SFS-like naming on top.

Directories

Path Synopsis
internal
pb
Package namesys_pb is a generated protocol buffer package.
Package namesys_pb is a generated protocol buffer package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL