mock

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: BSD-3-Clause Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotImplemented = errors.New("not implemented")

ErrNotImplemented denotes a function has not been implemented.

Functions

func NewResolver

func NewResolver(opts ...Option) resolver.Interface

NewResolver will create a new mock Resolver.

Types

type Option

type Option func(*Resolver)

Option function sets the option on the mock Resolver.

func WithResolveFunc

func WithResolveFunc(f func(string) (resolver.Address, error)) Option

WithResolveFunc will override the Resolve function implementation.

type Resolver

type Resolver struct {
	IsClosed bool
	// contains filtered or unexported fields
}

Resolver is the mock Resolver implementation.

func (*Resolver) Close

func (r *Resolver) Close() error

Close implements the Resolver interface.

func (*Resolver) Resolve

func (r *Resolver) Resolve(name string) (resolver.Address, error)

Resolve implements the Resolver interface.

Jump to

Keyboard shortcuts

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