config

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrOutOfRange number out of range
	ErrOutOfRange = errors.New("number: out of range")
	// ErrWrongFormat time format is not correct
	ErrWrongFormat = errors.New("time: wrong format")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	MaxAttempts uint8 `json:"maxAttempts"`
	PunchTime   Time  `json:"punchTime"`
}

Config config struct

func (Config) Check deprecated

func (cfg Config) Check() error

Check check config

Deprecated: use SetFlag to initialize config

func (*Config) SetFlag

func (cfg *Config) SetFlag(flag *flag.FlagSet)

SetFlag load config from args

func (Config) Show

func (cfg Config) Show(logger Printer)

Show return configuration

type Printer

type Printer interface {
	Printf(format string, v ...interface{})
}

Printer interface

type Time

type Time struct {
	Hour   int
	Minute int
}

Time time config for scheduler

Jump to

Keyboard shortcuts

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