config

package
v0.0.0-...-27de488 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: LGPL-2.1 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Changed bool

Functions

func InitConfig

func InitConfig()

func InitLog

func InitLog()

Can't be func init as we need the parsed config

func InitProfiling

func InitProfiling()

func LevelStrParse

func LevelStrParse(levelStr string) (level logrus.Level)

func PrepareConfig

func PrepareConfig()

func PrintMemUsage

func PrintMemUsage()

func ReloadConfig

func ReloadConfig() (bool, error)

func UpdateLogLevel

func UpdateLogLevel()

Types

type MainConfig

type MainConfig struct {
	CriticalCheckSec int
	NormalCheckSec   int
	LogFile          string
	LogFileSize      int
	LogLevel         string
	RLogLevel        string
	DownloadQuality  string
	DownloadDir      string
	UploadDir        string
	Module           []ModuleConfig
	ExpressPort      string
	EnableTS2MP4     bool
	ExtraConfig      map[string]interface{}
}
var Config *MainConfig

type ModuleConfig

type ModuleConfig struct {
	//EnableProxy     bool
	//Proxy           string
	Name             string
	Enable           bool
	Users            []UsersConfig
	DownloadProvider string
	ExtraConfig      map[string]interface{}
}

type UsersConfig

type UsersConfig struct {
	TargetId     string
	Name         string
	DownloadDir  string
	NeedDownload bool
	TransBiliId  string
	ExtraConfig  map[string]interface{}
}

type WriterHook

type WriterHook struct {
	Out       io.Writer
	Formatter logrus.Formatter
	LogLevel  logrus.Level
}

WriterHook is a hook that writes logs of specified LogLevels to specified Writer

var ConsoleHook *WriterHook

func (*WriterHook) Fire

func (hook *WriterHook) Fire(entry *logrus.Entry) error

Fire will be called when some logging function is called with current hook It will format logrus entry to string and write it to appropriate writer

func (*WriterHook) Levels

func (hook *WriterHook) Levels() []logrus.Level

Levels define on which logrus levels this hook would trigger

Jump to

Keyboard shortcuts

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