config

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigStr = `` /* 556-byte string literal not displayed */

Variables

View Source
var ConfigPath string
View Source
var Overrides = map[string]string{}

Functions

func DefaultStr

func DefaultStr() string

Types

type Config

type Config struct {
	Input      Input
	Outputs    Outputs `toml:"output"`
	Formatters Formatters
}

func DefaultConfig

func DefaultConfig() (Config, error)

func Load

func Load() (Config, error)

type Formatters added in v0.0.2

type Formatters map[string]map[string]any

func (Formatters) Json added in v0.0.2

func (ff Formatters) Json() (jf JsonFormat)

type Input

type Input struct {
	Path      string `env:"LOG_PATH"`
	Recurse   bool   `env:"LOG_RECURSE"`
	Ext       string `env:"LOG_EXT"`
	DotFolder bool   `env:"LOG_DOT_FOLDER"`
}

type JsonFormat added in v0.0.2

type JsonFormat struct {
	PrettyPrint bool `env:"LOG_JSON_PRETTY_PRINT" mapstructure:"pretty_print"`
}

type Output

type Output struct {
	Enabled bool
	Config  map[string]any
}

type Outputs

type Outputs map[string]Output

func (Outputs) Stdout

func (oo Outputs) Stdout() (s Stdout, enabled bool)

type Stdout

type Stdout struct {
	Format string `env:"LOG_STDOUT_FORMAT" mapstructure:"format"`
}

Jump to

Keyboard shortcuts

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