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

constant

package
v1.14.4 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: GPL-2.0 Imports: 8 Imported by: 249

Documentation

Index

Constants

View Source
const (
	CertificateStoreSystem  = "system"
	CertificateStoreMozilla = "mozilla"
	CertificateStoreChrome  = "chrome"
	CertificateStoreNone    = "none"
)
View Source
const (
	DHCPTTL     = time.Hour
	DHCPTimeout = 5 * time.Second
)
View Source
const (
	DNSTypeLegacy      = "legacy"
	DNSTypeUDP         = "udp"
	DNSTypeTCP         = "tcp"
	DNSTypeTLS         = "tls"
	DNSTypeHTTPS       = "https"
	DNSTypeQUIC        = "quic"
	DNSTypeHTTP3       = "h3"
	DNSTypeLocal       = "local"
	DNSTypeHosts       = "hosts"
	DNSTypeFakeIP      = "fakeip"
	DNSTypeDHCP        = "dhcp"
	DNSTypeMDNS        = "mdns"
	DNSTypeTailscale   = "tailscale"
	DNSTypeOpenConnect = "openconnect"
	DNSTypeOpenVPN     = "openvpn"
)
View Source
const (
	DNSProviderAliDNS     = "alidns"
	DNSProviderCloudflare = "cloudflare"
	DNSProviderACMEDNS    = "acmedns"
)
View Source
const (
	Hysteria2ObfsTypeSalamander = "salamander"
	Hysteria2ObfsTypeGecko      = "gecko"
)
View Source
const (
	Hysterai2MasqueradeTypeFile   = "file"
	Hysterai2MasqueradeTypeProxy  = "proxy"
	Hysterai2MasqueradeTypeString = "string"
)
View Source
const (
	NetNsTypeDefault = "default"
	NetNsTypeUnshare = "unshare"
)
View Source
const (
	ProtocolTLS        = "tls"
	ProtocolHTTP       = "http"
	ProtocolQUIC       = "quic"
	ProtocolDNS        = "dns"
	ProtocolSTUN       = "stun"
	ProtocolBitTorrent = "bittorrent"
	ProtocolDTLS       = "dtls"
	ProtocolSSH        = "ssh"
	ProtocolRDP        = "rdp"
	ProtocolNTP        = "ntp"
)
View Source
const (
	ClientChromium = "chromium"
	ClientSafari   = "safari"
	ClientFirefox  = "firefox"
	ClientQUICGo   = "quic-go"
	ClientUnknown  = "unknown"
)
View Source
const (
	TypeTun                = "tun"
	TypeRedirect           = "redirect"
	TypeTProxy             = "tproxy"
	TypeDirect             = "direct"
	TypeBridge             = "bridge"
	TypeBlock              = "block"
	TypeDNS                = "dns"
	TypeSOCKS              = "socks"
	TypeHTTP               = "http"
	TypeMixed              = "mixed"
	TypeShadowsocks        = "shadowsocks"
	TypeSnell              = "snell"
	TypeVMess              = "vmess"
	TypeTrojan             = "trojan"
	TypeNaive              = "naive"
	TypeWireGuard          = "wireguard"
	TypeHysteria           = "hysteria"
	TypeTor                = "tor"
	TypeSSH                = "ssh"
	TypeShadowTLS          = "shadowtls"
	TypeAnyTLS             = "anytls"
	TypeShadowsocksR       = "shadowsocksr"
	TypeVLESS              = "vless"
	TypeTUIC               = "tuic"
	TypeHysteria2          = "hysteria2"
	TypeOpenConnect        = "openconnect"
	TypeOpenVPNClient      = "openvpn-client"
	TypeOpenVPNServer      = "openvpn-server"
	TypeTailscale          = "tailscale"
	TypeCloudflared        = "cloudflared"
	TypeDERP               = "derp"
	TypeResolved           = "resolved"
	TypeSSMAPI             = "ssm-api"
	TypeAPI                = "api"
	TypeCCM                = "ccm"
	TypeOCM                = "ocm"
	TypeOOMKiller          = "oom-killer"
	TypeUSBIPServer        = "usbip-server"
	TypeUSBIPClient        = "usbip-client"
	TypeHysteriaRealm      = "hysteria-realm"
	TypeACME               = "acme"
	TypeCloudflareOriginCA = "cloudflare-origin-ca"
)
View Source
const (
	TypeSelector = "selector"
	TypeURLTest  = "urltest"
)
View Source
const (
	RuleTypeDefault = "default"
	RuleTypeLogical = "logical"
)
View Source
const (
	LogicalTypeAnd = "and"
	LogicalTypeOr  = "or"
)
View Source
const (
	RuleSetTypeInline   = "inline"
	RuleSetTypeLocal    = "local"
	RuleSetTypeRemote   = "remote"
	RuleSetFormatSource = "source"
	RuleSetFormatBinary = "binary"
)
View Source
const (
	RuleSetVersion1 = 1 + iota
	RuleSetVersion2
	RuleSetVersion3
	RuleSetVersion4
	RuleSetVersion5
	RuleSetVersionCurrent = RuleSetVersion5
)
View Source
const (
	RuleActionTypeRoute        = "route"
	RuleActionTypeRouteOptions = "route-options"
	RuleActionTypeEvaluate     = "evaluate"
	RuleActionTypeRespond      = "respond"
	RuleActionTypeBypass       = "bypass"
	RuleActionTypeReject       = "reject"
	RuleActionTypeHijackDNS    = "hijack-dns"
	RuleActionTypeSniff        = "sniff"
	RuleActionTypeResolve      = "resolve"
	RuleActionTypePredefined   = "predefined"
)
View Source
const (
	RuleActionRejectMethodDefault = "default"
	RuleActionRejectMethodDrop    = "drop"
	RuleActionRejectMethodReply   = "reply"
)
View Source
const (
	TCPKeepAliveInitial        = 5 * time.Minute
	TCPKeepAliveInterval       = 75 * time.Second
	TCPConnectTimeout          = 5 * time.Second
	TCPTimeout                 = 15 * time.Second
	ReadPayloadTimeout         = 300 * time.Millisecond
	DNSTimeout                 = 10 * time.Second
	UDPTimeout                 = 5 * time.Minute
	ICMPTimeout                = 10 * time.Second
	DefaultURLTestInterval     = 3 * time.Minute
	DefaultURLTestIdleTimeout  = 30 * time.Minute
	StartTimeout               = 10 * time.Second
	StopTimeout                = 5 * time.Second
	FatalStopTimeout           = 10 * time.Second
	FakeIPMetadataSaveInterval = 10 * time.Second
	TLSFragmentFallbackDelay   = 500 * time.Millisecond
)
View Source
const (
	TLSEngineDefault = ""
	TLSEngineGo      = "go"
	TLSEngineApple   = "apple"
	TLSEngineWindows = "windows"
)
View Source
const (
	V2RayTransportTypeHTTP        = "http"
	V2RayTransportTypeWebsocket   = "ws"
	V2RayTransportTypeQUIC        = "quic"
	V2RayTransportTypeGRPC        = "grpc"
	V2RayTransportTypeHTTPUpgrade = "httpupgrade"
)
View Source
const ACMETLS1Protocol = "acme-tls/1"
View Source
const CGO_ENABLED = true
View Source
const (
	DefaultDNSTTL = 600
)
View Source
const IsAndroid = goos.IsAndroid == 1
View Source
const IsDarwin = goos.IsDarwin == 1 || goos.IsIos == 1
View Source
const IsDragonfly = goos.IsDragonfly == 1
View Source
const IsFreebsd = goos.IsFreebsd == 1
View Source
const IsHurd = goos.IsHurd == 1
View Source
const IsIllumos = goos.IsIllumos == 1
View Source
const IsIos = goos.IsIos == 1
View Source
const IsJs = goos.IsJs == 1
View Source
const IsLinux = goos.IsLinux == 1 || goos.IsAndroid == 1
View Source
const IsNacl = goos.IsNacl == 1
View Source
const IsNetbsd = goos.IsNetbsd == 1
View Source
const IsOpenbsd = goos.IsOpenbsd == 1
View Source
const IsPlan9 = goos.IsPlan9 == 1
View Source
const IsSolaris = goos.IsSolaris == 1
View Source
const IsTvOS = false
View Source
const IsWindows = goos.IsWindows == 1
View Source
const IsZos = goos.IsZos == 1
View Source
const MbpsToBps = 125000
View Source
const RuleSetTagPlaceholder = "{tag}"
View Source
const TimeLayout = "2006-01-02 15:04:05 -0700"
View Source
const WithQUIC = false

Variables

View Source
var ErrQUICNotIncluded = E.New(`QUIC is not included in this build, rebuild with -tags with_quic`)
View Source
var ErrTLSRequired = E.New("TLS required")
View Source
var PortProtocols = map[uint16]string{
	53:   ProtocolDNS,
	123:  ProtocolNTP,
	3478: ProtocolSTUN,
	443:  ProtocolQUIC,
}
View Source
var ProtocolTimeouts = map[string]time.Duration{
	ProtocolDNS:  10 * time.Second,
	ProtocolNTP:  10 * time.Second,
	ProtocolSTUN: 10 * time.Second,
	ProtocolQUIC: 30 * time.Second,
	ProtocolDTLS: 30 * time.Second,
}
View Source
var (
	StringToInterfaceType = common.ReverseMap(interfaceTypeToString)
)
View Source
var (
	StringToNetworkStrategy = common.ReverseMap(networkStrategyToString)
)
View Source
var Version = "unknown"

Functions

func FindPath

func FindPath(name string) (string, bool)

func ProxyDisplayName added in v1.3.6

func ProxyDisplayName(proxyType string) string

Types

type DomainStrategy

type DomainStrategy = uint8
const (
	DomainStrategyAsIS DomainStrategy = iota
	DomainStrategyPreferIPv4
	DomainStrategyPreferIPv6
	DomainStrategyIPv4Only
	DomainStrategyIPv6Only
)

type InterfaceType added in v1.11.0

type InterfaceType uint8
const (
	InterfaceTypeWIFI InterfaceType = iota
	InterfaceTypeCellular
	InterfaceTypeEthernet
	InterfaceTypeOther
)

func (InterfaceType) String added in v1.11.0

func (t InterfaceType) String() string

type NetworkStrategy added in v1.11.0

type NetworkStrategy uint8
const (
	NetworkStrategyDefault NetworkStrategy = iota
	NetworkStrategyFallback
	NetworkStrategyHybrid
)

func (NetworkStrategy) String added in v1.11.0

func (s NetworkStrategy) String() string

Directories

Path Synopsis
package goos contains GOOS-specific constants.
package goos contains GOOS-specific constants.

Jump to

Keyboard shortcuts

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