namesys

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoResolver = errors.New("No resover for domain.")

ErrNoResolver signals no resolver exists for the specified domain.

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

ErrResolveFailed signals an error when attempting to resolve.

Functions

This section is empty.

Types

type DNSResolver

type DNSResolver struct {
	// contains filtered or unexported fields
}

DNSResolver implements a Resolver on DNS domains

func (*DNSResolver) Domains

func (r *DNSResolver) Domains() []string

Resolve implements Resolver.

func (*DNSResolver) Resolve

func (r *DNSResolver) Resolve(ctx context.Context, name string) (peer.ID, error)

Resolve implements Resolver.

type LookupTXTFunc

type LookupTXTFunc func(name string) (txt []string, err error)

type NameSystem

type NameSystem struct {
	// contains filtered or unexported fields
}

func NewNameSystem

func NewNameSystem(resolvers []Resolver) (*NameSystem, error)

func (*NameSystem) Resolve

func (n *NameSystem) Resolve(ctx context.Context, name string) (pid peer.ID, err error)

type Resolver

type Resolver interface {
	// Resolve a domain name into a PeerIDs
	Resolve(ctx context.Context, name string) (peer.ID, error)

	// Returns a list of domains this resolver knows how to resolve
	Domains() []string
}

A Resolver will resolve domain names into PeerIDs that can then been used in IPNS queries. OpenBazaar is intended to be agnostic to the underlying name systems as they all have their own positives and negatives. New name systems can be added by implementing the Resolver interface although only nodes which are updated with the new Resolver will be able to visit such domains.

func NewDNSResolver

func NewDNSResolver() Resolver

NewDNSResolver constructs a name resolver using DNS TXT records.

Jump to

Keyboard shortcuts

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