options

package
v3.0.0-...-ad58db6 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigFileName     = "/.hranoprovod/config"
	DefaultDbFilename  = "food.yaml"
	DefaultLogFilename = "log.yaml"
)

Variables

This section is empty.

Functions

func GetTimeFromString

func GetTimeFromString(now time.Time, format string, date string) (time.Time, error)

Types

type GlobalConfig

type GlobalConfig struct {
	Now         time.Time
	DbFileName  string
	LogFileName string
	DateFormat  string
}

func NewDefaultGlobalConfig

func NewDefaultGlobalConfig() GlobalConfig

type Options

type Options struct {
	GlobalConfig   GlobalConfig    `gcfg:"Global"`
	ResolverConfig resolver.Config `gcfg:"Resolver"`
	ParserConfig   parser.Config
	ReporterConfig reporter.Config
	FilterConfig   filter.Config
}

Options contains the options structure

func New

func New() *Options

New returns new options structure.

func (*Options) Load

func (o *Options) Load(c *cli.Context, useConfigFile bool) error

Load loads the settings from config file/command line params/defaults from given context.

Jump to

Keyboard shortcuts

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