cfg

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TotalIPListCapacity int = 10000

Functions

func ConfigTokens

func ConfigTokens(tokens string, baseConfigPath string) (string, error)

func MergedConfig

func MergedConfig(configPath string) ([]byte, error)

func NewConfig

func NewConfig(reader io.Reader) (*bouncerConfig, error)

NewConfig creates bouncerConfig from the file at provided path

Types

type AccountConfig

type AccountConfig struct {
	ID                  string       `yaml:"id"`
	ZoneConfigs         []ZoneConfig `yaml:"zones"`
	Token               string       `yaml:"token"`
	IPListPrefix        string       `yaml:"ip_list_prefix"`
	DefaultAction       string       `yaml:"default_action"`
	TotalIPListCapacity *int         `yaml:"total_ip_list_capacity"`
}

type CloudflareConfig

type CloudflareConfig struct {
	Accounts        []AccountConfig `yaml:"accounts"`
	UpdateFrequency time.Duration   `yaml:"update_frequency"`
}

type LoggingConfig

type LoggingConfig struct {
	LogLevel     *log.Level `yaml:"log_level"`
	LogMode      string     `yaml:"log_mode"`
	LogDir       string     `yaml:"log_dir"`
	LogMaxSize   int        `yaml:"log_max_size,omitempty"`
	LogMaxFiles  int        `yaml:"log_max_files,omitempty"`
	LogMaxAge    int        `yaml:"log_max_age,omitempty"`
	CompressLogs *bool      `yaml:"compress_logs,omitempty"`
}

func (*LoggingConfig) LoggerForFile

func (c *LoggingConfig) LoggerForFile(fileName string) (io.Writer, error)

type PrometheusConfig

type PrometheusConfig struct {
	Enabled       bool   `yaml:"enabled"`
	ListenAddress string `yaml:"listen_addr"`
	ListenPort    string `yaml:"listen_port"`
}

type ZoneConfig

type ZoneConfig struct {
	ID        string              `yaml:"zone_id"`
	Actions   []string            `yaml:"actions,omitempty"`
	ActionSet map[string]struct{} `yaml:",omitempty"`
}

Jump to

Keyboard shortcuts

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