Documentation ¶
Index ¶
- Variables
- func ListenerFromConfig(cfg Config, addr string, opts ...ServerOption) (net.Listener, error)
- func NewServer(options ...ServerOption) *tsnet.Server
- type Config
- type ServerMode
- type ServerOption
- func WithAuthKey(authKey string) ServerOption
- func WithControlURL(controlURL string) ServerOption
- func WithHostname(hostname string) ServerOption
- func WithLogFunc(logFunc func(format string, args ...interface{})) ServerOption
- func WithRunWebClient(runWebClient bool) ServerOption
- func WithStandardLoggingFunc(lvl zerolog.Level) ServerOption
- func WithStateDir(stateDir string) ServerOption
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMissingTailnetAuthKey = errors.New("missing tailnet preauth key") ErrMissingHostname = errors.New("missing hostname") ErrInvalidServerConfigurations = errors.New("invalid server configurations") ErrUnknownServerMode = errors.New("unknown server mode") )
View Source
var ( ErrInvalidAddress = errors.New("invalid address") ValidFunnelAddr = []string{":443", ":8443", ":1000"} )
Functions ¶
func ListenerFromConfig ¶
func NewServer ¶
func NewServer(options ...ServerOption) *tsnet.Server
Types ¶
type Config ¶
type Config struct { // Required, the authkey to join the tailnet AuthKey string `yaml:"authkey"` // The hostname to use on the tailnet Hostname string `yaml:"hostname"` // The directory to store the state of the tailnet. If not specified, the default will be used. StateDir string `yaml:"state"` // The mode to start the server, can be standard, tls or funnel. Defaults to standard. ModeStr string `yaml:"mode"` // ControlUrl is the URL of the control server to use. Specify this if you are using Headscale. If not specified, the default tailscale address will be used. ControlUrl string `yaml:"controlUrl"` // contains filtered or unexported fields }
func (*Config) Mode ¶
func (c *Config) Mode() ServerMode
type ServerMode ¶
type ServerMode int8
const ( ServerModeFunnel ServerMode = iota ServerModeTls SeverModeStandard ServerModeUnknown )
func ServerModeFromString ¶
func ServerModeFromString(s string) (ServerMode, error)
func (ServerMode) String ¶
func (s ServerMode) String() string
type ServerOption ¶
func WithAuthKey ¶
func WithAuthKey(authKey string) ServerOption
func WithControlURL ¶
func WithControlURL(controlURL string) ServerOption
func WithHostname ¶
func WithHostname(hostname string) ServerOption
func WithLogFunc ¶
func WithLogFunc(logFunc func(format string, args ...interface{})) ServerOption
func WithRunWebClient ¶
func WithRunWebClient(runWebClient bool) ServerOption
func WithStandardLoggingFunc ¶
func WithStandardLoggingFunc(lvl zerolog.Level) ServerOption
func WithStateDir ¶
func WithStateDir(stateDir string) ServerOption
Click to show internal directories.
Click to hide internal directories.