mock

package
v0.6.9 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2021 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is the mock resolver client implementation.

func NewClient

func NewClient(opts ...Option) *Client

NewClient construct a new mock Client.

func (*Client) Close

func (cl *Client) Close() error

Close is the mock Close implementation.

func (*Client) Endpoint

func (cl *Client) Endpoint() string

Endpoint is the mock Endpoint implementation.

func (*Client) IsConnected

func (cl *Client) IsConnected() bool

IsConnected is the mock IsConnected implementation.

func (*Client) Resolve

func (cl *Client) Resolve(name string) (swarm.Address, error)

Resolve is the mock Resolve implementation

type Option

type Option func(*Client)

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

func WitResolveAddress

func WitResolveAddress(addr swarm.Address) Option

WitResolveAddress will set the address returned by Resolve.

func WithEndpoint

func WithEndpoint(endpoint string) Option

WithEndpoint will set the endpoint.

func WithResolveFunc

func WithResolveFunc(fn func(string) (swarm.Address, error)) Option

WithResolveFunc will set the Resolve function implementation.

Jump to

Keyboard shortcuts

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