config

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateConfigFile

func CreateConfigFile() string

func InitConfig

func InitConfig(configPath string)

func ValidateConfig

func ValidateConfig() error

Types

type Authorization

type Authorization struct {
	APIToken string `mapstructure:"api_token"`
}

type Config

type Config struct {
	IndexerKeys   IndexerKeys   `mapstructure:"indexer_keys"`
	Authorization Authorization `mapstructure:"authorization"`
	UserIDs       UserIDs       `mapstructure:"userid"`
	Ratio         Ratio         `mapstructure:"ratio"`
	SizeCheck     SizeCheck     `mapstructure:"sizecheck"`
	ParsedSizes   ParsedSizeCheck
	Uploaders     Uploaders    `mapstructure:"uploaders"`
	RecordLabels  RecordLabels `mapstructure:"record_labels"`
	Logs          Logs         `mapstructure:"logs"`
}

func GetConfig

func GetConfig() *Config

type IndexerKeys

type IndexerKeys struct {
	REDKey string `mapstructure:"red_apikey"`
	OPSKey string `mapstructure:"ops_apikey"`
}

type Logs

type Logs struct {
	LogLevel    string `mapstructure:"loglevel"`
	LogToFile   bool   `mapstructure:"logtofile"`
	LogFilePath string `mapstructure:"logfilepath"`
	MaxSize     int    `mapstructure:"maxsize"`    // Max file size in MB
	MaxBackups  int    `mapstructure:"maxbackups"` // Max number of old log files to keep
	MaxAge      int    `mapstructure:"maxage"`     // Max age in days to keep a log file
	Compress    bool   `mapstructure:"compress"`   // Whether to compress old log files
}

type ParsedSizeCheck

type ParsedSizeCheck struct {
	MinSize bytesize.ByteSize
	MaxSize bytesize.ByteSize
}

type Ratio

type Ratio struct {
	MinRatio float64 `mapstructure:"minratio"`
}

type RecordLabels

type RecordLabels struct {
	RecordLabels string `mapstructure:"record_labels"`
}

type SizeCheck

type SizeCheck struct {
	MinSize string `mapstructure:"minsize"`
	MaxSize string `mapstructure:"maxsize"`
}

type Uploaders

type Uploaders struct {
	Uploaders string `mapstructure:"uploaders"`
	Mode      string `mapstructure:"mode"`
}

type UserIDs

type UserIDs struct {
	REDUserID int `mapstructure:"red_user_id"`
	OPSUserID int `mapstructure:"ops_user_id"`
}

Jump to

Keyboard shortcuts

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