object

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultAdminObjectName = "DefaultAdmin"

Variables

This section is empty.

Functions

This section is empty.

Types

type Admin

type Admin struct {
	Name, LogLevel string
	// contains filtered or unexported fields
}

Admin is the main object holding STUNner administration info

func (*Admin) Close

func (a *Admin) Close() error

Close closes the Admin object

func (*Admin) GetConfig

func (a *Admin) GetConfig() v1alpha1.Config

GetConfig returns the configuration of the running object

func (*Admin) ObjectName

func (a *Admin) ObjectName() string

Name returns the name of the object

func (*Admin) Reconcile

func (a *Admin) Reconcile(conf v1alpha1.Config) error

Reconcile updates the authenticator for a new configuration. Does require a server restart

type Auth

type Auth struct {
	Type                              v1alpha1.AuthType
	Realm, Username, Password, Secret string

	Handler turn.AuthHandler
	// contains filtered or unexported fields
}

Auth is the STUNner authenticator

func (*Auth) Close

func (auth *Auth) Close() error

Close closes the authenticator

func (*Auth) GetConfig

func (auth *Auth) GetConfig() v1alpha1.Config

GetConfig returns the configuration of the running authenticator

func (*Auth) ObjectName

func (auth *Auth) ObjectName() string

Name returns the name of the object

func (*Auth) Reconcile

func (auth *Auth) Reconcile(conf v1alpha1.Config) error

Reconcile updates the authenticator for a new configuration. Does not requre a server restart but existing TURN connections may fail to refresh permissions

type Cluster

type Cluster struct {
	Name      string
	Type      v1alpha1.ClusterType
	Endpoints []net.IPNet
	Domains   []string
	Resolver  resolver.DnsResolver // for strict DNS
	// contains filtered or unexported fields
}

Listener implements a STUNner cluster

func (*Cluster) Close

func (c *Cluster) Close() error

Close closes the cluster

func (*Cluster) GetConfig

func (c *Cluster) GetConfig() v1alpha1.Config

GetConfig returns the configuration of the running cluster

func (*Cluster) ObjectName

func (c *Cluster) ObjectName() string

Name returns the name of the object

func (*Cluster) Reconcile

func (c *Cluster) Reconcile(conf v1alpha1.Config) error

Reconcile updates a cluster. Does not require a server restart

func (*Cluster) Route

func (c *Cluster) Route(peer net.IP) bool

Route decides whwther a peer IP appears among the permitted endpoints of a cluster

type Listener

type Listener struct {
	Name                   string
	Proto                  v1alpha1.ListenerProtocol
	Addr                   net.IP
	Port, MinPort, MaxPort int
	Cert, Key              string      // net.IP.String() may rewrite the string representation
	Conn                   interface{} // either turn.ListenerConfig or turn.PacketConnConfig
	Routes                 []string

	Net *vnet.Net
	// contains filtered or unexported fields
}

Listener implements a STUNner listener

func (*Listener) Close

func (l *Listener) Close() error

Close closes the listener, required a restart!

func (*Listener) GetConfig

func (l *Listener) GetConfig() v1alpha1.Config

GetConfig returns the configuration of the running listener

func (*Listener) ObjectName

func (l *Listener) ObjectName() string

Name returns the name of the object

func (*Listener) Reconcile

func (l *Listener) Reconcile(conf v1alpha1.Config) error

Reconcile updates a listener. Requires a server restart (returns v1alpha1.ErrRestartRequired), unless only the Routes change

func (*Listener) String

func (l *Listener) String() string

String returns a short stable string representation of the listener, safe for applying as a key in a map

type Object

type Object interface {
	// ObjectName returns the name of the object
	ObjectName() string
	// Reconcile updates the object for a new configuration, may return ErrRestartRequired
	Reconcile(conf v1alpha1.Config) error
	// GetConfig returns the configuration of the running authenticator
	GetConfig() v1alpha1.Config
	// Close closes the object, may return ErrRestartRequired
	Close() error
}

Object is the high-level interface for all STUNner objects like listeners, clusters, etc.

func NewAdmin

func NewAdmin(conf v1alpha1.Config, logger logging.LoggerFactory) (Object, error)

NewAdmin creates a new Admin object. Requires a server restart (returns v1alpha1.ErrRestartRequired)

func NewAuth

func NewAuth(conf v1alpha1.Config, logger logging.LoggerFactory) (Object, error)

NewAuth creates a new authenticator. Requires a server restart (returns v1alpha1.ErrRestartRequired)

func NewCluster

func NewCluster(conf v1alpha1.Config, resolver resolver.DnsResolver,
	logger logging.LoggerFactory) (Object, error)

NewListener creates a new cluster. Does not require a server restart

func NewListener

func NewListener(conf v1alpha1.Config, net *vnet.Net, logger logging.LoggerFactory) (Object, error)

NewListener creates a new listener. Requires a server restart (returns v1alpha1.ErrRestartRequired)

Jump to

Keyboard shortcuts

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