config

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: May 7, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ListenAddr of the HTTP service
	ListenAddr = FlagEnvString("addr", "HTTP service address", ":8080")
	// PublicURL used for PSHB subscriptions
	PublicURL = FlagEnvString("public-url", "Public URL used for PSHB subscriptions", "")
	// DB location
	DB = FlagEnvString("db", "Database location", "boltdb://data.db")
	// LogLevel (debug/info/warn/error)
	LogLevel = FlagEnvString("log-level", "Logging level", "info")
	// LogPretty writes log using text format
	LogPretty = FlagEnvBool("log-pretty", "Writes log using plain text format", false)
	// Delay is the delay between aggregations
	Delay = FlagEnvDuration("delay", "Delay between aggregations", 1*time.Minute)
	// Timeout is the aggregation timeout
	Timeout = FlagEnvDuration("timeout", "Aggregation timeout", 5*time.Second)
	// CacheRetention is the duration of the cache retention
	CacheRetention = FlagEnvDuration("cache-retention", "Cache retention duration", 72*time.Hour)
	// SentryDSN is the Sentru DSN URL
	SentryDSN = FlagEnvString("sentry-dsn", "Sentry DSN URL", "")
	// ImportFilename is the OPML file to import at boot time
	ImportFilename = FlagString("import", "Import a OPML file at boot time", "")
	// ClearCache is a flag to clear the cache
	ClearCache = FlagBool("clear-cache", "Clear cache at bootstrap", false)
	// Version is a flag to display the version
	Version = FlagBool("version", "Show version", false)
	// Outputs destinations
	Outputs = FlagEnvArray("output", "Output destination", []string{"stdout://"})
	// Plugins to load
	Plugins = FlagEnvArray("plugin", "Plugin to load", []string{})
	// Filters to load
	Filters = FlagEnvArray("filter", "Plugin to load", []string{})
)

Functions

func FlagBool

func FlagBool(key, desc string, fallback bool) *bool

FlagBool returns env bool value with fallback

func FlagEnvBool

func FlagEnvBool(key, desc string, fallback bool) *bool

FlagEnvBool returns flag or env bool value with fallback

func FlagEnvDuration

func FlagEnvDuration(key, desc string, fallback time.Duration) *time.Duration

FlagEnvDuration returns flag or env duration value with fallback

func FlagEnvInt

func FlagEnvInt(key, desc string, fallback int) *int

FlagEnvInt returns flag or env int value with fallback

func FlagEnvString

func FlagEnvString(key, desc, fallback string) *string

FlagEnvString returns flag or env string value with fallback

func FlagString

func FlagString(key, desc, fallback string) *string

FlagString returns flag string value with fallback

Types

type ArrayFlags

type ArrayFlags struct {
	// contains filtered or unexported fields
}

ArrayFlags contains an array of command flags

func FlagEnvArray

func FlagEnvArray(key, desc string, fallback []string) *ArrayFlags

FlagEnvArray returns flag or env array value with fallback

func (*ArrayFlags) Set

func (i *ArrayFlags) Set(value string) error

Set is used to add a value to the flag array

func (*ArrayFlags) String

func (i *ArrayFlags) String() string

String return the string value of a flag array

func (*ArrayFlags) Values

func (i *ArrayFlags) Values() []string

Values return the values of a flag array

Jump to

Keyboard shortcuts

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