model

package
v0.9.12 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2025 License: Apache-2.0 Imports: 13 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 (
	CNUnknown = ClientNextProto{}
	CNv02     = ClientNextProto{"connet-client/0.2"} // 0.8.0
)
View Source
var (
	RNUnknown = RelayNextProto{}
	RNv02     = RelayNextProto{"connet-relay/0.2"} // 0.8.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 AllClientNextProtos = []ClientNextProto{CNv02}
View Source
var AllConnectDirectNextProtos = []ConnectDirectNextProto{CCv01}
View Source
var AllConnectRelayNextProtos = []ConnectRelayNextProto{CRv01}
View Source
var AllRelayNextProtos = []RelayNextProto{RNv02}
View Source
var (
	CCv01 = ConnectDirectNextProto{"connet-peer/0.1"} // 0.7.0
)
View Source
var (
	CRv01 = ConnectRelayNextProto{"connet-peer-relay/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 PBFromEndpoints added in v0.9.0

func PBFromEndpoints(eps []Endpoint) []*pbmodel.Endpoint

Types

type ClientNextProto added in v0.8.0

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

func GetClientNextProto added in v0.8.0

func GetClientNextProto(conn *quic.Conn) ClientNextProto

func (ClientNextProto) String added in v0.8.0

func (v ClientNextProto) String() string

type ConnectDirectNextProto added in v0.8.0

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

func (ConnectDirectNextProto) String added in v0.8.0

func (v ConnectDirectNextProto) String() string

type ConnectRelayNextProto added in v0.8.0

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

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 NewKeyRaw added in v0.7.0

func NewKeyRaw(raw []byte) Key

func NewKeyString added in v0.7.0

func NewKeyString(s string) Key

func NewKeyTLS added in v0.7.0

func NewKeyTLS(cert tls.Certificate) 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 RelayNextProto added in v0.8.0

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

func GetRelayNextProto added in v0.8.0

func GetRelayNextProto(conn *quic.Conn) RelayNextProto

func (RelayNextProto) String added in v0.8.0

func (v RelayNextProto) 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