cfg

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ValidActions = []string{"ban", "captcha", "count"}

Functions

func MergedConfig

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

func NewConfig

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

Types

type AclConfig

type AclConfig struct {
	WebACLName           string `yaml:"web_acl_name"`
	RuleGroupName        string `yaml:"rule_group_name"`
	Region               string `yaml:"region"`
	Scope                string `yaml:"scope"`
	IpsetPrefix          string `yaml:"ipset_prefix"`
	FallbackAction       string `yaml:"fallback_action"`
	AWSProfile           string `yaml:"aws_profile"`
	IPHeader             string `yaml:"ip_header"`
	IPHeaderPosition     string `yaml:"ip_header_position"`
	Capacity             int    `yaml:"capacity"`
	CloudWatchEnabled    bool   `yaml:"cloudwatch_enabled"`
	CloudWatchMetricName string `yaml:"cloudwatch_metric_name"`
	SampleRequests       bool   `yaml:"sample_requests"`
}

type LoggingConfig

type LoggingConfig struct {
	LogLevel     *log.Level `yaml:"log_level"`
	LogMedia     string     `yaml:"log_media"`
	LogDir       string     `yaml:"log_dir"`
	LogMaxSize   int        `yaml:"log_max_size,omitempty"`
	LogMaxFiles  int        `yaml:"log_max_backups,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)

Jump to

Keyboard shortcuts

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