ens

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: BSD-3-Clause Imports: 9 Imported by: 2 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidContentHash denotes that the value of the contenthash record is
	// not valid.
	ErrInvalidContentHash = errors.New("invalid swarm content hash")
	// ErrResolveFailed is returned when a name could not be resolved.
	ErrResolveFailed = errors.New("resolve failed")
	// ErrNameNotFound is returned when a name resolves to an empty contenthash
	// record.
	ErrNameNotFound = errors.New("name not found")
)

Functions

This section is empty.

Types

type Address

type Address = swarm.Address

Address is the swarm bzz address.

type Client

type Client struct {
	Endpoint string
	// contains filtered or unexported fields
}

Client is a name resolution client that can connect to ENS via an Ethereum endpoint.

func NewClient

func NewClient(opts ...Option) *Client

NewClient will return a new Client.

func (*Client) Close

func (c *Client) Close() error

Close closes the RPC connection with the client, terminating all unfinished requests. Function obtains a write lock while interacting with the Ethereum client.

func (*Client) Connect

func (c *Client) Connect(ep string) error

Connect implements the resolver.Client interface.

func (*Client) IsConnected

func (c *Client) IsConnected() bool

IsConnected returns true if there is an active RPC connection with an Ethereum node at the configured endpoint. Function obtains a write lock while interacting with the Ethereum client.

func (*Client) Resolve

func (c *Client) Resolve(name string) (Address, error)

Resolve implements the resolver.Client interface. Function obtains a read lock while interacting with the Ethereum client.

type Option

type Option func(*Client)

Option is a function that applies an option to a Client.

Jump to

Keyboard shortcuts

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