mock

package
v1.17.5 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: BSD-3-Clause Imports: 3 Imported by: 2 modules, 1 package

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

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