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 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 RelayClientKey
- type RelayClientValue
- type RelayConnKey
- type RelayConnValue
- type RelayEndpointKey
- type RelayEndpointValue
- type RelayID
- type RelayServerKey
- type RelayServerValue
- type Server
- type Status
- type StatusClient
- type StatusPeer
- type StatusRelay
- type Stores
Constants ¶
This section is empty.
Variables ¶
View Source
var ClientIDNil = ClientID{""}
View Source
var RelayIDNil = RelayID{""}
Functions ¶
This section is empty.
Types ¶
type ClientAuthenticateRequest ¶ added in v0.7.0
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 ClientConnKey struct {
ID ClientID `json:"id"`
}
type ClientConnValue ¶
type ClientConnValue struct {
Authentication ClientAuthentication `json:"authentication"`
Addr string `json:"addr"`
}
type ClientID ¶ added in v0.10.0
type ClientID struct {
// contains filtered or unexported fields
}
func NewClientID ¶ added in v0.10.0
func NewClientID() ClientID
func (ClientID) MarshalText ¶ added in v0.10.0
func (*ClientID) UnmarshalText ¶ added in v0.10.0
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 IngressBuilder ¶ added in v0.8.0
type IngressBuilder struct {
// contains filtered or unexported fields
}
func NewIngressBuilder ¶ added in v0.8.0
func NewIngressBuilder() *IngressBuilder
func (*IngressBuilder) Error ¶ added in v0.8.0
func (b *IngressBuilder) Error() error
func (*IngressBuilder) Ingress ¶ added in v0.8.0
func (b *IngressBuilder) Ingress() (Ingress, error)
func (*IngressBuilder) WithAddr ¶ added in v0.8.0
func (b *IngressBuilder) WithAddr(addr *net.UDPAddr) *IngressBuilder
func (*IngressBuilder) WithAddrFrom ¶ added in v0.8.0
func (b *IngressBuilder) WithAddrFrom(addrStr string) *IngressBuilder
func (*IngressBuilder) WithRestr ¶ added in v0.8.0
func (b *IngressBuilder) WithRestr(iprestr restr.IP) *IngressBuilder
func (*IngressBuilder) WithRestrFrom ¶ added in v0.8.0
func (b *IngressBuilder) WithRestrFrom(allows []string, denies []string) *IngressBuilder
func (*IngressBuilder) WithTLS ¶ added in v0.8.0
func (b *IngressBuilder) WithTLS(cfg *tls.Config) *IngressBuilder
func (*IngressBuilder) WithTLSCert ¶ added in v0.8.0
func (b *IngressBuilder) WithTLSCert(cert tls.Certificate) *IngressBuilder
func (*IngressBuilder) WithTLSCertFrom ¶ added in v0.8.0
func (b *IngressBuilder) WithTLSCertFrom(certFile, keyFile string) *IngressBuilder
type RelayAuthenticateRequest ¶ added in v0.7.0
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 RelayClientKey ¶
type RelayClientValue ¶
type RelayClientValue struct {
Cert *x509.Certificate `json:"cert"`
Authentication ClientAuthentication `json:"authentication"`
}
func (RelayClientValue) MarshalJSON ¶
func (v RelayClientValue) MarshalJSON() ([]byte, error)
func (*RelayClientValue) UnmarshalJSON ¶
func (v *RelayClientValue) UnmarshalJSON(b []byte) error
type RelayConnKey ¶
type RelayConnKey struct {
ID RelayID `json:"id"`
}
type RelayConnValue ¶
type RelayConnValue struct {
Authentication RelayAuthentication `json:"authentication"`
Hostport model.HostPort `json:"hostport"`
Hostports []model.HostPort `json:"hostports"`
}
type RelayEndpointKey ¶ added in v0.9.0
type RelayEndpointValue ¶ added in v0.9.0
type RelayEndpointValue struct {
Cert *x509.Certificate `json:"cert"`
}
func (RelayEndpointValue) MarshalJSON ¶ added in v0.9.0
func (v RelayEndpointValue) MarshalJSON() ([]byte, error)
func (*RelayEndpointValue) UnmarshalJSON ¶ added in v0.9.0
func (v *RelayEndpointValue) UnmarshalJSON(b []byte) error
type RelayID ¶ added in v0.10.0
type RelayID struct {
// contains filtered or unexported fields
}
func NewRelayID ¶ added in v0.10.0
func NewRelayID() RelayID
func (RelayID) MarshalText ¶ added in v0.10.0
func (*RelayID) UnmarshalText ¶ added in v0.10.0
type RelayServerKey ¶
type RelayServerValue ¶
type RelayServerValue struct {
Hostport model.HostPort `json:"hostport"`
Hostports []model.HostPort `json:"hostports"`
Cert *x509.Certificate `json:"cert"`
}
func (RelayServerValue) MarshalJSON ¶
func (v RelayServerValue) MarshalJSON() ([]byte, error)
func (*RelayServerValue) UnmarshalJSON ¶
func (v *RelayServerValue) UnmarshalJSON(b []byte) error
type Status ¶ added in v0.4.0
type Status struct {
ServerID string `json:"server_id"`
Clients []StatusClient `json:"clients"`
Peers []StatusPeer `json:"peers"`
Relays []StatusRelay `json:"relays"`
}
type StatusClient ¶ added in v0.4.0
type StatusPeer ¶ added in v0.4.0
type StatusRelay ¶ added in v0.4.0
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)
RelayClients() (logc.KV[RelayClientKey, RelayClientValue], error)
RelayEndpoints(id RelayID) (logc.KV[RelayEndpointKey, RelayEndpointValue], error)
RelayServers() (logc.KV[RelayServerKey, RelayServerValue], error)
RelayServerOffsets() (logc.KV[RelayConnKey, int64], error)
}
func NewFileStores ¶
Click to show internal directories.
Click to hide internal directories.