model

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NoEncryption    = EncryptionScheme{"none"}
	TLSEncryption   = EncryptionScheme{"tls"}
	DHXCPEncryption = EncryptionScheme{"dhxcp"}
)
View Source
var (
	NoPolicy           = LoadBalancePolicy{}
	LeastLatencyPolicy = LoadBalancePolicy{"least-latency"}
	LeastConnsPolicy   = LoadBalancePolicy{"least-conns"}
	RoundRobinPolicy   = LoadBalancePolicy{"round-robin"}
	RandomPolicy       = LoadBalancePolicy{"random"}
)
View Source
var (
	NeverRetry = LoadBalanceRetry{}
	CountRetry = LoadBalanceRetry{"count"}
	TimedRetry = LoadBalanceRetry{"timed"}
	AllRetry   = LoadBalanceRetry{"all"}
)
View Source
var (
	ClientControlUnknown = ClientControlNextProto{}
	ClientControlV02     = ClientControlNextProto{"connet-client/0.2"} // 0.8.0
	ClientControlV03     = ClientControlNextProto{"connet-client/0.3"} // 0.13.0

)
View Source
var (
	ConnectRelayUnknown = ConnectRelayNextProto{}
	ConnectRelayV01     = ConnectRelayNextProto{"connet-peer-relay/0.1"} // 0.7.0
	ConnectRelayV02     = ConnectRelayNextProto{"connet-peer-relay/0.2"} // 0.13.0
)
View Source
var (
	RelayControlUnknown = RelayControlNextProto{}
	RelayControlV02     = RelayControlNextProto{"connet-relay/0.2"} // 0.8.0
	RelayControlV03     = RelayControlNextProto{"connet-relay/0.3"} // 0.13.0

)
View Source
var (
	ProxyNone = ProxyVersion{"none"}
	ProxyV1   = ProxyVersion{"v1"}
	ProxyV2   = ProxyVersion{"v2"}
)
View Source
var (
	UnknownRole = Role{}
	Destination = Role{"destination"}
	Source      = Role{"source"}
)
View Source
var (
	RouteAny    = RouteOption{"any"}
	RouteDirect = RouteOption{"direct"}
	RouteRelay  = RouteOption{"relay"}
)
View Source
var (
	ConnectClientV01 = ConnectClientNextProto{"connet-peer/0.1"} // 0.7.0
)
View Source
var Version string

Injected by ldflags

Functions

func BuildVersion added in v0.7.0

func BuildVersion() string

func EndpointNames added in v0.9.0

func EndpointNames(eps []Endpoint) []string

func PBFromEncryptions added in v0.6.0

func PBFromEncryptions(schemes []EncryptionScheme) []pbconnect.RelayEncryptionScheme

func PBsFromHostPorts added in v0.12.0

func PBsFromHostPorts(hps []HostPort) []*pbmodel.HostPort

Types

type ClientControlNextProto added in v0.12.0

type ClientControlNextProto struct {
	// contains filtered or unexported fields
}

ClientControlNextProto describes TLS NextProtos for clients connecting to control servers

func GetClientControlNextProto added in v0.12.0

func GetClientControlNextProto(conn *quic.Conn) ClientControlNextProto

func (ClientControlNextProto) String added in v0.12.0

func (v ClientControlNextProto) String() string

type ConnectClientNextProto added in v0.12.0

type ConnectClientNextProto struct {
	// contains filtered or unexported fields
}

ConnectClientNextProto describes TLS NextProtos for clients connecting to other clients

func (ConnectClientNextProto) String added in v0.12.0

func (v ConnectClientNextProto) String() string

type ConnectRelayNextProto added in v0.8.0

type ConnectRelayNextProto struct {
	// contains filtered or unexported fields
}

ConnectRelayNextProto describes TLS NextProtos for clients connecting to relays

func GetConnectRelayNextProto added in v0.13.0

func GetConnectRelayNextProto(conn *quic.Conn) ConnectRelayNextProto

func (ConnectRelayNextProto) String added in v0.8.0

func (v ConnectRelayNextProto) String() string

type EncryptionScheme added in v0.6.0

type EncryptionScheme struct {
	// contains filtered or unexported fields
}

func EncryptionFromPB added in v0.6.0

func EncryptionsFromPB added in v0.6.0

func EncryptionsFromPB(pbs []pbconnect.RelayEncryptionScheme) []EncryptionScheme

func ParseEncryptionScheme added in v0.6.0

func ParseEncryptionScheme(s string) (EncryptionScheme, error)

func SelectEncryptionScheme added in v0.6.0

func SelectEncryptionScheme(dst []EncryptionScheme, src []EncryptionScheme) (EncryptionScheme, error)

func (EncryptionScheme) PB added in v0.6.0

type Endpoint added in v0.9.0

type Endpoint struct {
	// contains filtered or unexported fields
}

func EndpointFromPB added in v0.9.0

func EndpointFromPB(f *pbmodel.Endpoint) Endpoint

func NewEndpoint added in v0.9.0

func NewEndpoint(s string) Endpoint

func (Endpoint) MarshalText added in v0.9.0

func (f Endpoint) MarshalText() ([]byte, error)

func (Endpoint) PB added in v0.9.0

func (f Endpoint) PB() *pbmodel.Endpoint

func (Endpoint) String added in v0.9.0

func (f Endpoint) String() string

func (*Endpoint) UnmarshalText added in v0.9.0

func (f *Endpoint) UnmarshalText(b []byte) error

type HostPort

type HostPort struct {
	Host string `json:"host"`
	Port uint16 `json:"port"`
}

func HostPortFromPB

func HostPortFromPB(h *pbmodel.HostPort) HostPort

func HostPortFromPBs added in v0.8.0

func HostPortFromPBs(hs []*pbmodel.HostPort) []HostPort

func (HostPort) PB

func (h HostPort) PB() *pbmodel.HostPort

func (HostPort) String

func (h HostPort) String() string

type Key added in v0.7.0

type Key struct {
	// contains filtered or unexported fields
}

func NewKey added in v0.7.0

func NewKey(cert *x509.Certificate) Key

func NewKeyString added in v0.7.0

func NewKeyString(s string) Key

func (Key) IsValid added in v0.7.0

func (k Key) IsValid() bool

func (Key) MarshalText added in v0.7.0

func (k Key) MarshalText() ([]byte, error)

func (Key) String added in v0.7.0

func (k Key) String() string

func (*Key) UnmarshalText added in v0.7.0

func (k *Key) UnmarshalText(b []byte) error

type LoadBalancePolicy added in v0.9.4

type LoadBalancePolicy struct {
	// contains filtered or unexported fields
}

func ParseLBPolicy added in v0.9.4

func ParseLBPolicy(s string) (LoadBalancePolicy, error)

type LoadBalanceRetry added in v0.9.4

type LoadBalanceRetry struct {
	// contains filtered or unexported fields
}

func ParseLBRetry added in v0.9.4

func ParseLBRetry(s string) (LoadBalanceRetry, error)

type ProxyProtoConn added in v0.6.0

type ProxyProtoConn interface {
	WriteProxyHeader(sourceAddr, destAddr net.Addr) error
}

type ProxyVersion added in v0.5.0

type ProxyVersion struct {
	// contains filtered or unexported fields
}

func ParseProxyVersion added in v0.5.0

func ParseProxyVersion(s string) (ProxyVersion, error)

func ProxyVersionFromPB added in v0.5.0

func ProxyVersionFromPB(r pbconnect.ProxyProtoVersion) ProxyVersion

func (ProxyVersion) PB added in v0.5.0

func (ProxyVersion) Wrap added in v0.6.0

func (v ProxyVersion) Wrap(conn net.Conn) net.Conn

type RelayControlNextProto added in v0.12.0

type RelayControlNextProto struct {
	// contains filtered or unexported fields
}

RelayControlNextProto describes TLS NextProtos for relays connecting to control servers

func GetRelayControlNextProto added in v0.12.0

func GetRelayControlNextProto(conn *quic.Conn) RelayControlNextProto

func (RelayControlNextProto) String added in v0.12.0

func (v RelayControlNextProto) String() string

type Role

type Role struct {
	// contains filtered or unexported fields
}

func ParseRole added in v0.5.0

func ParseRole(s string) (Role, error)

func RoleFromPB

func RoleFromPB(r pbmodel.Role) Role

func (Role) Invert

func (r Role) Invert() Role

func (Role) MarshalText

func (r Role) MarshalText() ([]byte, error)

func (Role) PB

func (r Role) PB() pbmodel.Role

func (Role) String

func (r Role) String() string

func (*Role) UnmarshalText

func (r *Role) UnmarshalText(b []byte) error

type RouteOption

type RouteOption struct {
	// contains filtered or unexported fields
}

func ParseRouteOption

func ParseRouteOption(s string) (RouteOption, error)

func (RouteOption) AllowDirect

func (r RouteOption) AllowDirect() bool

func (RouteOption) AllowFrom

func (r RouteOption) AllowFrom(from RouteOption) bool

func (RouteOption) AllowRelay

func (r RouteOption) AllowRelay() bool

Jump to

Keyboard shortcuts

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