openbazaar-go/namesys

Version: 0.12.4

Source: https://github.com/OpenBazaar/openbazaar-go/

import "github.com/OpenBazaar/openbazaar-go/namesys"

Overview

Index

Variables

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

ErrNoResolver signals no resolver exists for the specified domain.

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

ErrResolveFailed signals an error when attempting to resolve.

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 postives 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.


Generated by godoc2md