Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertToV1(sv1a1 *StunnerConfig) (*stnrv1.StunnerConfig, error)
- type AdminConfig
- type AuthConfig
- type AuthType
- type ClusterConfig
- type ClusterProtocol
- type ClusterType
- type Config
- type ErrRestarted
- type ListenerConfig
- type ListenerProtocol
- type StunnerConfig
- func (req *StunnerConfig) ConfigName() string
- func (req *StunnerConfig) DeepCopyInto(dst Config)
- func (req *StunnerConfig) DeepEqual(conf Config) bool
- func (req *StunnerConfig) GetClusterConfig(name string) (ClusterConfig, error)
- func (req *StunnerConfig) GetListenerConfig(name string) (ListenerConfig, error)
- func (req *StunnerConfig) String() string
- func (req *StunnerConfig) Validate() error
Constants ¶
const ApiVersion string = "v1alpha1"
const DefaultAdminName = "default-admin-config"
const DefaultAuthName = "default-auth-config"
const DefaultAuthType = "plaintext"
const DefaultClusterProtocol = "udp"
const DefaultClusterType = "STATIC"
const DefaultHealthCheckPort int = 8086
const DefaultLogLevel = "all:INFO"
const DefaultMaxRelayPort int = 1<<16 - 1
const DefaultMetricsPort int = 8080
const DefaultMinRelayPort int = 1 << 15
const DefaultPort int = 3478
const DefaultProtocol = "turn-udp"
const DefaultRealm = "stunner.l7mp.io"
const DefaultStunnerName = "default-stunnerd"
Variables ¶
var ( ErrInvalidConf = stnrv1.ErrInvalidConf ErrNoSuchListener = stnrv1.ErrNoSuchListener ErrNoSuchCluster = stnrv1.ErrNoSuchCluster )
Functions ¶
func ConvertToV1 ¶ added in v0.16.1
func ConvertToV1(sv1a1 *StunnerConfig) (*stnrv1.StunnerConfig, error)
ConvertToV1 upgrades a v1alpha1 StunnerConfig to a v1.
Types ¶
type AdminConfig ¶
type AdminConfig = stnrv1.AdminConfig
AdminConfig holds the administrative configuration.
type AuthConfig ¶
type AuthConfig struct { // Type is the type of the STUN/TURN authentication mechanism ("plaintext" or "longterm"). Type string `json:"type,omitempty"` // Realm defines the STUN/TURN authentication realm. Realm string `json:"realm,omitempty"` // Credentials specifies the authententication credentials: for "plaintext" at least the // keys "username" and "password" must be set, for "longterm" the key "secret" will hold // the shared authentication secret. Credentials map[string]string `json:"credentials"` }
Auth defines the specification of the STUN/TURN authentication mechanism used by STUNner.
func (*AuthConfig) ConfigName ¶
func (req *AuthConfig) ConfigName() string
Name returns the name of the object to be configured.
func (*AuthConfig) DeepCopyInto ¶ added in v0.14.1
func (req *AuthConfig) DeepCopyInto(dst Config)
DeepCopyInto copies a configuration.
func (*AuthConfig) DeepEqual ¶
func (req *AuthConfig) DeepEqual(other Config) bool
DeepEqual compares two configurations.
func (*AuthConfig) String ¶
func (req *AuthConfig) String() string
String stringifies the configuration.
func (*AuthConfig) Validate ¶
func (req *AuthConfig) Validate() error
Validate checks a configuration and injects defaults.
type AuthType ¶
AuthType species the type of the STUN/TURN authentication mechanism used by STUNner
const ( AuthTypePlainText AuthType = AuthType(stnrv1.AuthTypeStatic) AuthTypeLongTerm AuthType = AuthType(stnrv1.AuthTypeLongTerm) AuthTypeUnknown AuthType = AuthType(stnrv1.AuthTypeUnknown) )
func NewAuthType ¶
NewAuthType parses the authentication mechanism specification
type ClusterConfig ¶
type ClusterConfig = stnrv1.ClusterConfig
ClusterConfig specifies a set of upstream peers STUNner can open transport relay connections to. There are two address resolution policies. In STATIC clusters the allowed peer IP addresses are explicitly listed in the endpoint list. In STRICT_DNS clusters the endpoints are assumed to be proper DNS domain names. STUNner will resolve each domain name in the background and admits a new connection only if the peer address matches one of the IP addresses returned by the DNS resolver for one of the endpoints. STRICT_DNS clusters are best used with headless Kubernetes services.
type ClusterProtocol ¶ added in v0.11.2
type ClusterProtocol = stnrv1.ClusterProtocol
ClusterProtocol specifies the network protocol for a cluster
type ClusterType ¶
type ClusterType = stnrv1.ClusterType
ClusterType specifies the cluster address resolution policy
type ErrRestarted ¶ added in v0.11.3
type ErrRestarted = stnrv1.ErrRestarted
type ListenerConfig ¶
type ListenerConfig = stnrv1.ListenerConfig
ListenerConfig specifies a server socket on which STUN/TURN connections will be served.
type ListenerProtocol ¶
type ListenerProtocol = stnrv1.ListenerProtocol
ListenerProtocol specifies the network protocol for a listener
type StunnerConfig ¶
type StunnerConfig struct { // ApiVersion is the version of the STUNner API implemented. ApiVersion string `json:"version"` // AdminConfig holds administrative configuration. Admin AdminConfig `json:"admin,omitempty"` // Auth defines the STUN/TURN authentication mechanism. Auth AuthConfig `json:"auth"` // Listeners defines the server sockets exposed to clients. Listeners []ListenerConfig `json:"listeners,omitempty"` // Clusters defines the upstream endpoints to which relay transport connections can be made // by clients. Clusters []ClusterConfig `json:"clusters,omitempty"` }
StunnerConfig specifies the configuration of the the STUnner daemon.
func (*StunnerConfig) ConfigName ¶
func (req *StunnerConfig) ConfigName() string
Name returns the name of the object to be configured.
func (*StunnerConfig) DeepCopyInto ¶ added in v0.14.1
func (req *StunnerConfig) DeepCopyInto(dst Config)
DeepCopyInto copies a configuration.
func (*StunnerConfig) DeepEqual ¶
func (req *StunnerConfig) DeepEqual(conf Config) bool
DeepEqual compares two configurations.
func (*StunnerConfig) GetClusterConfig ¶ added in v0.11.3
func (req *StunnerConfig) GetClusterConfig(name string) (ClusterConfig, error)
GetClusterConfig finds a Cluster by name in a StunnerConfig or returns an error.
func (*StunnerConfig) GetListenerConfig ¶ added in v0.11.3
func (req *StunnerConfig) GetListenerConfig(name string) (ListenerConfig, error)
GetListenerConfig finds a Listener by name in a StunnerConfig or returns an error.
func (*StunnerConfig) String ¶
func (req *StunnerConfig) String() string
String stringifies the configuration.
func (*StunnerConfig) Validate ¶
func (req *StunnerConfig) Validate() error
Validate checks if a listener configuration is correct.