Documentation
¶
Index ¶
- Variables
- type ClientAuthenticateRequest
- type ClientAuthentication
- type ClientAuthenticator
- type ClientConnKey
- type ClientConnValue
- type ClientID
- type ClientPeerKey
- type ClientPeerValue
- type ClientRelays
- type Config
- type ConfigKey
- type ConfigValue
- type ConnID
- type Ingress
- type IngressBuilder
- func (b *IngressBuilder) Error() error
- func (b *IngressBuilder) Ingress() (Ingress, error)
- func (b *IngressBuilder) WithAddr(addr *net.UDPAddr) *IngressBuilder
- func (b *IngressBuilder) WithAddrFrom(addrStr string) *IngressBuilder
- func (b *IngressBuilder) WithRestr(iprestr restr.IP) *IngressBuilder
- func (b *IngressBuilder) WithRestrFrom(allows []string, denies []string) *IngressBuilder
- func (b *IngressBuilder) WithTLS(cfg *tls.Config) *IngressBuilder
- func (b *IngressBuilder) WithTLSCert(cert tls.Certificate) *IngressBuilder
- func (b *IngressBuilder) WithTLSCertFrom(certFile, keyFile string) *IngressBuilder
- type RelayAuthenticateRequest
- type RelayAuthentication
- type RelayAuthenticator
- type RelayConnKey
- type RelayConnValue
- type RelayID
- type Server
- type Status
- type StatusClient
- type StatusEndpoint
- type StatusEndpointRemote
- type StatusIngress
- type StatusRelay
- type Stores
Constants ¶
This section is empty.
Variables ¶
View Source
var ClientIDNil = ClientID{""}
View Source
var ConnIDNil = ConnID{""}
View Source
var RelayIDNil = RelayID{""}
Functions ¶
This section is empty.
Types ¶
type ClientAuthentication ¶
type ClientAuthentication []byte
type ClientAuthenticator ¶
type ClientAuthenticator interface {
Authenticate(req ClientAuthenticateRequest) (ClientAuthentication, error)
Validate(auth ClientAuthentication, endpoint model.Endpoint, role model.Role) (model.Endpoint, error)
}
type ClientConnKey ¶
type ClientConnValue ¶
type ClientConnValue struct {
Authentication ClientAuthentication `json:"authentication"`
Addr string `json:"addr"`
Metadata string `json:"metadata"`
}
type ClientID ¶
type ClientID struct {
// contains filtered or unexported fields
}
func NewClientID ¶
func NewClientID() ClientID
func (ClientID) MarshalText ¶
func (*ClientID) UnmarshalText ¶
type ClientPeerKey ¶
type ClientPeerValue ¶
type ClientRelays ¶
type Config ¶
type Config struct {
ClientsIngress []Ingress
ClientsAuth ClientAuthenticator
RelaysIngress []Ingress
RelaysAuth RelayAuthenticator
Stores Stores
Logger *slog.Logger
}
type ConfigValue ¶
type ConnID ¶ added in v0.14.0
type ConnID struct {
// contains filtered or unexported fields
}
func (ConnID) MarshalText ¶ added in v0.14.0
func (*ConnID) UnmarshalText ¶ added in v0.14.0
type IngressBuilder ¶
type IngressBuilder struct {
// contains filtered or unexported fields
}
func NewIngressBuilder ¶
func NewIngressBuilder() *IngressBuilder
func (*IngressBuilder) Error ¶
func (b *IngressBuilder) Error() error
func (*IngressBuilder) Ingress ¶
func (b *IngressBuilder) Ingress() (Ingress, error)
func (*IngressBuilder) WithAddr ¶
func (b *IngressBuilder) WithAddr(addr *net.UDPAddr) *IngressBuilder
func (*IngressBuilder) WithAddrFrom ¶
func (b *IngressBuilder) WithAddrFrom(addrStr string) *IngressBuilder
func (*IngressBuilder) WithRestr ¶
func (b *IngressBuilder) WithRestr(iprestr restr.IP) *IngressBuilder
func (*IngressBuilder) WithRestrFrom ¶
func (b *IngressBuilder) WithRestrFrom(allows []string, denies []string) *IngressBuilder
func (*IngressBuilder) WithTLS ¶
func (b *IngressBuilder) WithTLS(cfg *tls.Config) *IngressBuilder
func (*IngressBuilder) WithTLSCert ¶
func (b *IngressBuilder) WithTLSCert(cert tls.Certificate) *IngressBuilder
func (*IngressBuilder) WithTLSCertFrom ¶
func (b *IngressBuilder) WithTLSCertFrom(certFile, keyFile string) *IngressBuilder
type RelayAuthentication ¶
type RelayAuthentication []byte
type RelayAuthenticator ¶
type RelayAuthenticator interface {
Authenticate(req RelayAuthenticateRequest) (RelayAuthentication, error)
Allow(reAuth RelayAuthentication, clAuth ClientAuthentication, endpoint model.Endpoint) (bool, error)
}
type RelayConnKey ¶
type RelayConnKey struct {
ID RelayID `json:"id"`
}
type RelayConnValue ¶
type RelayConnValue struct {
Authentication RelayAuthentication `json:"authentication"`
Hostports []model.HostPort `json:"hostports"`
Metadata string `json:"metadata"`
Certificate *x509.Certificate `json:"certificate"`
AuthenticationSealKey *[32]byte `json:"authentication-seal-key"`
}
func (RelayConnValue) MarshalJSON ¶ added in v0.14.0
func (v RelayConnValue) MarshalJSON() ([]byte, error)
func (*RelayConnValue) UnmarshalJSON ¶ added in v0.14.0
func (v *RelayConnValue) UnmarshalJSON(b []byte) error
type RelayID ¶
type RelayID struct {
// contains filtered or unexported fields
}
func NewRelayID ¶
func NewRelayID() RelayID
func (RelayID) MarshalText ¶
func (*RelayID) UnmarshalText ¶
type Status ¶
type Status struct {
BuildVersion string `json:"build-version"`
ClientIngresses []StatusIngress `json:"client-ingresses"`
Clients map[string]StatusClient `json:"clients"`
Endpoints map[string]StatusEndpoint `json:"endpoints"`
RelayServerID string `json:"relay-server-id"`
RelayIngresses []StatusIngress `json:"relay-ingresses"`
Relays map[string]StatusRelay `json:"relays"`
}
type StatusClient ¶
type StatusEndpoint ¶
type StatusEndpoint struct {
Endpoint model.Endpoint `json:"endpoint"`
Destinations []StatusEndpointRemote `json:"destinations"`
Sources []StatusEndpointRemote `json:"sources"`
}
type StatusEndpointRemote ¶ added in v0.14.0
type StatusIngress ¶
type StatusIngress struct {
Address string `json:"address"`
Restrictions restr.IP `json:"restrictions"`
}
func StatusIngressFn ¶
func StatusIngressFn(ing Ingress) StatusIngress
type StatusRelay ¶
type Stores ¶
type Stores interface {
Config() (logc.KV[ConfigKey, ConfigValue], error)
ClientConns() (logc.KV[ClientConnKey, ClientConnValue], error)
ClientPeers() (logc.KV[ClientPeerKey, ClientPeerValue], error)
RelayConns() (logc.KV[RelayConnKey, RelayConnValue], error)
RemoveDeprecated() error
}
func NewFileStores ¶
Click to show internal directories.
Click to hide internal directories.