config

package
v0.0.0-...-4070c14 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogFormatDefault   string = "default"
	LogFormatBitshield string = LogFormatDefault
	LogFormatSyslog    string = "syslog"
)
View Source
const (
	HTTP string = "http"
)

Variables

View Source
var (
	ConfigDir   string = "/etc/bitshield/"
	TLSDir      string
	ConfigFile  string
	TLSKeyFile  string
	TLSCertFile string
)

Functions

func ExtractTheListFile

func ExtractTheListFile(files []string) (list []string)

func ExtractTheRegexListFile

func ExtractTheRegexListFile(files []string) (list []*regexp.Regexp)

func SetPath

func SetPath(configName string) error

Types

type Config

type Config struct {
	IPAddress string     `toml:"ipaddress"`
	Port      int        `toml:"port"`
	Protocol  string     `toml:"protocol"`
	HTTP      HTTPConfig `toml:"http"`
}

func GenerateDefaultConfig

func GenerateDefaultConfig() (cnf Config)

func Load

func Load(file string) (Config, error)

func (Config) MakeTemplateFile

func (cnf Config) MakeTemplateFile(file string) error

type HTTPConfig

type HTTPConfig struct {
	IPAddress   string     `toml:"ipaddress"`
	Port        int        `toml:"port"`
	ListenLimit int        `toml:"listen_limit"`
	Verbose     bool       `toml:"verbose"`
	MITM        bool       `toml:"mitm"`
	TLS         bool       `toml:"tls"`
	TLSCertFile string     `toml:"tls_cert_file"`
	TLSKeyFile  string     `toml:"tls_key_file"`
	ACL         aclConfig  `toml:"acl"`
	Perm        permConfig `toml:"perm"`
	Log         LogConfig  `toml:"log"`
	AccessLog   LogConfig  `toml:"access_log"`
}

type LogConfig

type LogConfig struct {
	Enable          bool   `toml:"enable"`
	File            string `toml:"file"`
	BufferArraySize int    `toml:"buffer_array_size"`
	Format          string `toml:"format"`
}

Jump to

Keyboard shortcuts

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