mock

package
v1.12.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: BSD-3-Clause Imports: 2 Imported by: ? modules, 0 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

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