Help us shape the future of Go! Take the 2026 Go Developer Survey

hosts

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StatusOK Means that direct access to the resource definitely exists.
	StatusOK = iota + 1
	// StatusMaybeOK Means that direct access is available, but we are not sure about it.
	StatusMaybeOK
	// StatusProxyOK Means that access via a proxy works better than direct access.
	StatusProxyOK
	// StatusMaybeError Means that there are problems with direct access, and we are not sure if a proxy will help.
	StatusMaybeError
	// StatusError Means that there is definitely an issue with direct access and access via proxy.
	StatusError
)

Variables

This section is empty.

Functions

func Hosts

func Hosts() any

func Init

func Init()

func Resolve

func Resolve(host string) string

Types

type HostChecker

type HostChecker struct {
	Handler func(rawURL string) (status int, body []byte, err error)
	// contains filtered or unexported fields
}

func (*HostChecker) Check

func (h *HostChecker) Check(host string) (int, error)

func (*HostChecker) MarshalJSON

func (h *HostChecker) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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