v1alpha1

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const ApiVersion string = "v1alpha1"
View Source
const DefaultAdminName = "default-admin-config"
View Source
const DefaultAuthName = "default-auth-config"
View Source
const DefaultAuthType = "plaintext"
View Source
const DefaultClusterProtocol = "udp"
View Source
const DefaultClusterType = "STATIC"
View Source
const DefaultHealthCheckPort int = 8086
View Source
const DefaultLogLevel = "all:INFO"
View Source
const DefaultMaxRelayPort int = 1<<16 - 1
View Source
const DefaultMetricsPort int = 8080
View Source
const DefaultMinRelayPort int = 1 << 15
View Source
const DefaultPort int = 3478
View Source
const DefaultProtocol = "turn-udp"
View Source
const DefaultRealm = "stunner.l7mp.io"
View Source
const DefaultStunnerName = "default-stunnerd"

Variables

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

type AuthType stnrv1.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

func NewAuthType(raw string) (AuthType, error)

NewAuthType parses the authentication mechanism specification

func (AuthType) String

func (a AuthType) String() string

String returns a string representation for the authentication mechanism

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 Config

type Config = stnrv1.Config

Config is the main interface for STUNner configuration objects

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL