config

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const BufferSize = 1500

BufferSize is the max size of a single message transferred via a tunnel. This should be sufficiently large to prevent fragmentation.

Variables

View Source
var AgentDefault = Agent{
	GatewayURL: "ws://localhost:9000",
}

AgentDefault is a default agent configuration.

View Source
var ServerDefault = Server{
	ControlAddress: "localhost:9000",
	LetsEncrypt:    LetsEncrypt{CacheDir: ".autocert_cache"},
}

ServerDefault is a default server configuration.

Functions

func Load

func Load(path string, conf interface{}) error

Load loads a YAML document from a file and fills in corresponding fields of conf variable. Default values given in the variable are honored.

Types

type Agent

type Agent struct {
	GatewayURL string    `yaml:"gateway_url"`
	AuthKey    string    `yaml:"auth_key"`
	Forwards   []Forward `yaml:"forwards"`
}

Agent represnets a configuration of a reverse tunnel agent program.

func (*Agent) Check added in v1.3.2

func (conf *Agent) Check() error

Check checks agent config for obvious mistakes. Returns a non-nil error if a bad configuration is found.

type AgentAuth

type AgentAuth struct {
	AuthKey string          `yaml:"auth_key"`
	Ports   []ports.NetPort `yaml:"ports"`
}

AgentAuth represents an agent and its access rights authorized in a reverse tunnel server program.

type Forward

type Forward struct {
	Port        ports.NetPort `yaml:"port"`
	Destination string        `yaml:"destination"`
}

Forward represents a configuration of a single port forwarding.

type LetsEncrypt added in v1.2.0

type LetsEncrypt struct {
	Domain   string `yaml:"domain"`
	CacheDir string `yaml:"cache_dir"`
}

LetsEncrypt represents autocert configuration for the server.

type Server

type Server struct {
	ControlAddress string      `yaml:"control_address"`
	LetsEncrypt    LetsEncrypt `yaml:"lets_encrypt"`
	Agents         []AgentAuth `yaml:"agents"`
}

Server represents a configuration of a reverse tunnel server program.

func (*Server) Check added in v1.3.2

func (conf *Server) Check() error

Check checks agent config for obvious mistakes. Returns a non-nil error if a bad configuration is found.

Jump to

Keyboard shortcuts

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