model

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2025 License: Apache-2.0 Imports: 9 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 (
	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"}
)

Functions

func GenServerName

func GenServerName(prefix string) string

func PBFromEncryptions added in v0.6.0

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

func PBFromForwards

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

Types

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 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 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