config

package
v0.0.0-...-c8bca88 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustCreateLogger

func MustCreateLogger() *zap.Logger

func Read

func Read(cfgFiles ...string) error

Read reads in config file and ENV variables if set.

Types

type RemoteConfig

type RemoteConfig struct {
	Name           string `mapstructure:"name"`
	Username       string `mapstructure:"username"`
	Password       string `mapstructure:"password"`
	AuthToken      string `mapstructure:"-"`
	URL            string `mapstructure:"url"`
	Root           string `mapstructure:"root"`
	PrivateKeyPath string `mapstructure:"private_key_path"`
}

type RootConfig

type RootConfig struct {
	UpdateInterval       time.Duration
	UpdateIntervalString string          `mapstructure:"update_interval"`
	Remotes              []*RemoteConfig `mapstructure:"remotes"`
	Rules                []*RulesConfig  `mapstructure:"rules"`
}
var Global *RootConfig

type RulesConfig

type RulesConfig struct {
	Name    string   `mapstructure:"name"`
	Root    string   `mapstructure:"root"`
	Pattern string   `mapstructure:"pattern"`
	Remotes []string `mapstructure:"remotes"`
	Server  string   `mapstructure:"server"`
}

func (*RulesConfig) SrcFile

func (rc *RulesConfig) SrcFile(f fs.FileInfo) string

Jump to

Keyboard shortcuts

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