config

package
v0.0.0-...-88a36fa Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultConfigPath = "/etc/espy/espy.yaml"

DefaultConfigPath specifies the path of RITA's static config file

Variables

View Source
var ExactVersion = "undefined"

ExactVersion is filled at compile time with the git version of RITA ExactVersion is filled by "git describe --always --long --dirty --tags"

View Source
var Version = "undefined"

Version is filled at compile time with the git version of RITA Version is filled by "git describe --abbrev=0 --tags"

Functions

This section is empty.

Types

type Config

type Config struct {
	S StaticCfg
	R RunningCfg
}

Config holds the configuration for the running system

func LoadConfig

func LoadConfig(customConfigPath string) (*Config, error)

LoadConfig initializes a Config struct with values read from a config file. It takes a string for the path to the file. If the string is empty it uses the default path.

type ESRunningCfg

type ESRunningCfg struct {
	TLSConfig *tls.Config
}

type ESStaticCfg

type ESStaticCfg struct {
	Host     string       `yaml:"Host"`
	User     string       `yaml:"User"`
	Password string       `yaml:"Password"`
	TLS      TLSStaticCfg `yaml:"TLS"`
}

type RedisRunningCfg

type RedisRunningCfg struct {
	TLSConfig *tls.Config
}

type RedisStaticCfg

type RedisStaticCfg struct {
	Host     string       `yaml:"Host"`
	User     string       `yaml:"User"`
	Password string       `yaml:"Password"`
	TLS      TLSStaticCfg `yaml:"TLS"`
}

type RunningCfg

type RunningCfg struct {
	Redis         RedisRunningCfg
	Elasticsearch ESRunningCfg
	Version       semver.Version
}

type StaticCfg

type StaticCfg struct {
	Redis         RedisStaticCfg `yaml:"Redis"`
	Elasticsearch ESStaticCfg    `yaml:"Elasticsearch"`
	Zeek          ZeekCfg        `yaml:"Zeek"`
	LogLevel      int            `yaml:"LogLevel" default:"3"`
	Version       string
	ExactVersion  string
}

StaticCfg is the container for other static config sections

type TLSStaticCfg

type TLSStaticCfg struct {
	Enabled           bool   `yaml:"Enable" default:"false"`
	VerifyCertificate bool   `yaml:"VerifyCertificate" default:"false"`
	CAFile            string `yaml:"CAFile" default:""`
}

type ZeekCfg

type ZeekCfg struct {
	OutputPath string `yaml:"Path" default:"/opt/zeek/logs"`
	RotateLogs bool   `yaml:"Rotate" default:"true"`
}

Jump to

Keyboard shortcuts

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