model

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 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 (
	CNUnknown = ClientToControlProto{}
	CNv00     = ClientToControlProto{"connet"}
	CNv01     = ClientToControlProto{"connet-client/0.1"}
)
View Source
var (
	CCv00 = ClientToClientProto{"connet-direct"}
	CCv01 = ClientToClientProto{"connet-peer/0.1"}
)
View Source
var (
	CRv00 = ClientToRelayProto{"connet-relay"}
	CRv01 = ClientToRelayProto{"connet-peer-relay/0.1"}
)
View Source
var (
	RNUnknown = RelayToControlProto{}
	RNv00     = RelayToControlProto{"connet-relays"}
	RNv01     = RelayToControlProto{"connet-relay/0.1"}
)
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 ClientToClientNextProtos = iterc.MapSlice(ClientToClientProtos, ClientToClientProto.String)
View Source
var ClientToClientProtos = []ClientToClientProto{CCv00, CCv01}
View Source
var ClientToControlNextProtos = iterc.MapSlice(ClientToControlProtos, ClientToControlProto.String)
View Source
var ClientToControlProtos = []ClientToControlProto{CNv01, CNv00}
View Source
var ClientToRelayNextProtos = iterc.MapSlice(ClientToRelayProtos, ClientToRelayProto.String)
View Source
var ClientToRelayProtos = []ClientToRelayProto{CRv01, CRv00}
View Source
var RelayToControlNextProtos = iterc.MapSlice(RelayToControlProtos, RelayToControlProto.String)
View Source
var RelayToControlProtos = []RelayToControlProto{RNv01, RNv00}

Functions

func BuildVersion added in v0.7.0

func BuildVersion() string

func ForwardNames added in v0.7.0

func ForwardNames(fwds []Forward) []string

func PBFromEncryptions added in v0.6.0

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

func PBFromForwards

func PBFromForwards(fwds []Forward) []*pb.Forward

Types

type ClientToClientProto added in v0.7.0

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

func (ClientToClientProto) String added in v0.7.0

func (v ClientToClientProto) String() string

type ClientToControlProto added in v0.7.0

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

func GetClientToControlProto added in v0.7.0

func GetClientToControlProto(conn quic.Connection) ClientToControlProto

func (ClientToControlProto) String added in v0.7.0

func (v ClientToControlProto) String() string

type ClientToRelayProto added in v0.7.0

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

func (ClientToRelayProto) String added in v0.7.0

func (v ClientToRelayProto) 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 EncryptionFromPB(pb pbc.RelayEncryptionScheme) EncryptionScheme

func EncryptionsFromPB added in v0.6.0

func EncryptionsFromPB(pbs []pbc.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 Forward

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

func ForwardFromPB

func ForwardFromPB(f *pb.Forward) Forward

func NewForward

func NewForward(s string) Forward

func (Forward) MarshalText

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

func (Forward) PB

func (f Forward) PB() *pb.Forward

func (Forward) String

func (f Forward) String() string

func (*Forward) UnmarshalText

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

type HostPort

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

func HostPortFromPB

func HostPortFromPB(h *pb.HostPort) HostPort

func (HostPort) PB

func (h HostPort) PB() *pb.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 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 pbc.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 RelayToControlProto added in v0.7.0

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

func GetRelayToControlProto added in v0.7.0

func GetRelayToControlProto(conn quic.Connection) RelayToControlProto

func (RelayToControlProto) String added in v0.7.0

func (v RelayToControlProto) 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 pb.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() pb.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