config

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(filename string, cfg interface{}) error

Load loads a configuration file.

Types

type Allow added in v0.1.9

type Allow struct {
	Type               string           `yaml:"type"`
	Endpoint           string           `yaml:"endpoint"`
	IgnoreErrors       []string         `yaml:"ignore_errors"`
	IgnoreErrorsRegexp []*regexp.Regexp `yaml:"-"`
}

An Allow is a list of allowed endpoints wit options.

type AllowWrapper added in v0.1.9

type AllowWrapper struct {
	Allow
}

func (*AllowWrapper) UnmarshalYAML added in v0.1.9

func (a *AllowWrapper) UnmarshalYAML(value *yaml.Node) error

type Client

type Client struct {
	Identifier string         `yaml:"identifier"`
	Server     Connection     `yaml:"server"`
	Secret     string         `yaml:"secret"`
	Public     string         `yaml:"public"`
	Log        Log            `yaml:"log"`
	Inbound    bool           `yaml:"inbound"`
	AllowList  []AllowWrapper `yaml:"allow_list"`
	Outbounds  []Outbound     `yaml:"outbounds"`
}

A Client holds client's configuration fields.

type Connection

type Connection struct {
	Address string `yaml:"address"`
	Secret  string `yaml:"secret"`
	Public  string `yaml:"public"`
}

A Connection handles connection details.

type Log

type Log struct {
	Level          string `yaml:"level"`
	ForceColor     bool   `yaml:"force_color"`
	ForceFormating bool   `yaml:"force_formating"`
}

A Log handles logging details.

type Outbound

type Outbound struct {
	Identifier  string `yaml:"identifier"`
	Source      string `yaml:"source"`
	Destination string `yaml:"destination"`
}

A Outbound handles tunneling details.

type Server

type Server struct {
	Connection `yaml:",inline"`
	Clients    map[string]string `yaml:"clients"`
	Log        Log               `yaml:"log"`
	AllowList  []AllowWrapper    `yaml:"allow_list"`
	Outbounds  []Outbound        `yaml:"outbounds"`
}

A Server holds server's configuration fields.

Jump to

Keyboard shortcuts

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