config

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 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)

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

Types

type ModelConfig

type ModelConfig struct {
	Name         string
	TempPath     string
	DumpPath     string
	CompressWith SubConfig
	EncryptWith  SubConfig
	StoreWith    SubConfig
	Archive      *viper.Viper
	Databases    []SubConfig
	Storages     []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 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