dnscachedial

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Control

type Control struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Control is the type of a cache controller.

func New

func New() *Control

New creates a new DNS cache.

func (*Control) Cache

func (c *Control) Cache(ctx context.Context, addr string) (err error)

Cache explicitly adds an address to the DNS cache.

func (*Control) Cover

func (c *Control) Cover(orig DialCtxFunc) DialCtxFunc

Cover creates a new DNS caching DialCtxFunc from an original DialCtxFunc.

func (*Control) Flush

func (c *Control) Flush()

Flush flushes the cache, removing all cached addresses.

func (*Control) Get

func (c *Control) Get(addr string) (r []string)

Get retrieves the cached resolved addresses of addr.

type DialCtxFunc

type DialCtxFunc func(context.Context, string, string) (net.Conn, error)

Jump to

Keyboard shortcuts

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