config

package
v0.0.0-...-63b2e14 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	SSHServer   SSHServer   `toml:"ssh_server"`
	HTTPServer  HTTPServer  `toml:"http_server"`
	DebugServer DebugServer `toml:"debug_server"`
}

func NewConfig

func NewConfig(cfgFile string) (*Config, error)

func (*Config) Validate

func (c *Config) Validate() error

type DebugServer

type DebugServer struct {
	BindAddress string `toml:"bind_address"`
	BindPort    int    `toml:"bind_port"`
	Enabled     bool   `toml:"enabled"`
}

func (DebugServer) BindAddressString

func (d DebugServer) BindAddressString() string

func (DebugServer) Validate

func (d DebugServer) Validate() error

type HTTPServer

type HTTPServer struct {
	BindAddr string `toml:"bind_address"`
	BindPort int    `toml:"bind_port"`

	ExcludedSubdomains []string `toml:"excluded_subdomains"`
	DomainName         string   `toml:"domain_name"`

	UseTLS      bool      `toml:"use_tls" json:"use-tls"`
	TLSBindPort int       `toml:"tls_bind_port" json:"tls-bind-port"`
	TLSConfig   TLSConfig `toml:"tls" json:"tls"`
}

func (*HTTPServer) BindAddress

func (a *HTTPServer) BindAddress() string

BindAddress returns a host:port string.

func (*HTTPServer) TLSBindAddress

func (a *HTTPServer) TLSBindAddress() string

TLSBindAddress returns a host:port string.

func (*HTTPServer) Validate

func (a *HTTPServer) Validate() error

type SSHServer

type SSHServer struct {
	BindAddress string `toml:"bind_address"`
	BindPort    int    `toml:"bind_port"`

	HostKeyPath        string `toml:"host_key_path"`
	AuthorizedKeysPath string `toml:"authorized_keys_path"`
	DisableAuth        bool   `toml:"disable_auth"`
}

func (SSHServer) SSHServerConfig

func (c SSHServer) SSHServerConfig() (*ssh.ServerConfig, error)

func (SSHServer) Validate

func (c SSHServer) Validate() error

type TLSConfig

type TLSConfig struct {
	CRT string `toml:"certificate" json:"certificate"`
	Key string `toml:"key" json:"key"`
}

func (*TLSConfig) Validate

func (t *TLSConfig) Validate() error

Validate validates the TLS config

Jump to

Keyboard shortcuts

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