config

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Exist Is config file exist
	Exist bool
	// Models configs
	Models []ModelConfig
	// HomeDir of user
	HomeDir = os.Getenv("HOME")
)

Functions

func Init

func Init(configFile string, dumpPath string)

loadConfig from: - ./payung.yml - ~/.payung/payung.yml - /etc/payung/payung.yml

Types

type ModelConfig

type ModelConfig struct {
	Name              string
	TempPath          string
	DumpPath          string
	CompressWith      SubConfig
	EncryptWith       SubConfig
	StoreWith         SubConfig
	Archive           *viper.Viper
	SplitIntoChunksOf int
	Databases         []SubConfig
	Storages          []SubConfig
	Notifiers         []SubConfig
	Viper             *viper.Viper
}

ModelConfig for special case

func GetModelByName

func GetModelByName(name string) (model *ModelConfig)

GetModelByName get model by name

func (*ModelConfig) GetDatabaseByName

func (model *ModelConfig) GetDatabaseByName(name string) (subConfig *SubConfig)

GetDatabaseByName get database config by name

type ModelRunInfo

type ModelRunInfo struct {
	// 0 = Job was successfull
	// 1 = Job failed
	// 2 = Job interupted
	ExitStatus int
	StartedAt  time.Time
	FinishedAt time.Time
}

type SubConfig

type SubConfig struct {
	Name  string
	Type  string
	Viper *viper.Viper
}

SubConfig sub config info

Jump to

Keyboard shortcuts

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