ens

package
v1.18.2 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: BSD-3-Clause Imports: 10 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 (
	// ErrFailedToConnect denotes that the resolver failed to connect to the
	// provided endpoint.
	ErrFailedToConnect = errors.New("failed to connect")
	// ErrResolveFailed denotes that a name could not be resolved.
	ErrResolveFailed = errors.New("resolve failed")
	// ErrNotImplemented denotes that the function has not been implemented.
	ErrNotImplemented = errors.New("function not implemented")
)

Functions

func NewClient

func NewClient(endpoint string, opts ...Option) (client.Interface, error)

NewClient will return a new Client.

Types

type Address

type Address = swarm.Address

Address is the swarm bzz address.

type Client

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

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

func (*Client) Close

func (c *Client) Close() error

Close closes the RPC connection with the client, terminating all unfinished requests. If the connection is already closed, this call is a noop.

func (*Client) Endpoint

func (c *Client) Endpoint() string

Endpoint returns the endpoint the client was connected to.

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.

func (*Client) Resolve

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

Resolve implements the resolver.Client interface.

type Option

type Option func(*Client)

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

func WithContractAddress added in v0.4.1

func WithContractAddress(addr string) Option

WithContractAddress will set the ENS contract address.

Jump to

Keyboard shortcuts

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