config

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StdIn io.Reader = os.Stdin

StdIn is default stdin reader

Functions

func New

func New(fs *flag.FlagSet, args []string) (*Config, *Flags, error)

New creates new config instance

Types

type Config

type Config struct {
	// Scripts section for define script sources
	Scripts *scripts.Scripts `json:"scripts" yaml:"scripts" hcl:"scripts,block"`
	// DataSources section for define data sources
	DataSources *datasources.DataSources `json:"datasources" yaml:"datasources" hcl:"datasources,block"`
	// Channels section for define channels
	Channels *channels.Channels `json:"channels" yaml:"channels" hcl:"channels,block"`
	// StoragesUpload section for define upload storages
	StoragesUpload *upload.Upload `json:"storagesUpload" yaml:"storagesUpload" hcl:"storagesUpload,block"`
	// StoragesCore section for define core storages
	StoragesCore *core.Core `json:"storagesCore" yaml:"storagesCore" hcl:"storagesCore,block"`
	// API section for define API settings
	API *api.API `json:"api" yaml:"api" hcl:"api,block"`

	// LuaModulesPath for path to lua modules
	LuaModulesPath string `json:"luaModulesPath" yaml:"luaModulesPath" hcl:"luaModulesPath,optional"`
	// StorageAlert item
	StorageAlert string `json:"storageAlert" yaml:"storageAlert" hcl:"storageAlert,optional"`
	// StorageKV item
	StorageKV string `json:"storageKV" yaml:"storageKV" hcl:"storageKV,optional"`

	System *system.System `json:"system" yaml:"system" hcl:"system,block"`
}

Config represent balerter configuration

func (Config) Validate

func (cfg Config) Validate() error

Validate the config

type Flags added in v0.7.0

type Flags struct {
	// ConfigFilePath for CLI flag '-script'
	ConfigFilePath string
	// LogLevel for CLI flag '-logLevel'
	LogLevel string
	// Debug for CLI flag '-debug'
	Debug bool
	// Once for CLI flag '-once'
	Once bool
	// Script for CLI flag '-script'
	Script string
	// for CLI flag '-asJson' for test tool
	AsJSON bool
}

Flags represents CLI flags

Jump to

Keyboard shortcuts

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