utils

package
v1.0.8-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoRouteToHost         = errors.New("no route to host")
	ErrNoSuchHost            = errors.New("no such host")
	ErrConnectionRefused     = errors.New("connection refused")
	ErrConnectionTimedOut    = errors.New("connection timed out")
	ErrConnectionResetByPeer = errors.New("connection reset by peer")
	ErrIOTimeout             = errors.New("i/o timeout")
)

Common i/o related errors

Functions

func IsErr

func IsErr(err error, target error) bool

IsErr can be used to compare an error to a target and also works when used on errors that haven't been wrapped since it will fall back to a string comparison. Useful to check errors returned over the network.

func ResolveHostIP added in v1.0.8

func ResolveHostIP(ctx context.Context, hostIP string) (subnets []string, private bool, _ error)

Types

type TreeMux added in v1.0.8

type TreeMux struct {
	Handler http.Handler
	Sub     map[string]TreeMux
}

func (TreeMux) ServeHTTP added in v1.0.8

func (t TreeMux) ServeHTTP(w http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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