curveadm

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KEY_LOG_LEVEL    = "log_level"
	KEY_SUDO_ALIAS   = "sudo_alias"
	KEY_ENGINE       = "engine"
	KEY_TIMEOUT      = "timeout"
	KEY_AUTO_UPGRADE = "auto_upgrade"
	KEY_SSH_RETRIES  = "retries"
	KEY_SSH_TIMEOUT  = "timeout"
	KEY_DB_URL       = "url"

	// rqlite://127.0.0.1:4000
	// sqlite:///home/curve/.curveadm/data/curveadm.db
	REGEX_DB_URL = "^(sqlite|rqlite)://(.+)$"
	DB_SQLITE    = "sqlite"
	DB_RQLITE    = "rqlite"

	WITHOUT_SUDO = " "
)

* [defaults] * log_level = error * sudo_alias = "sudo" * timeout = 180 * * [ssh_connections] * retries = 3 * timeout = 10 * * [database] * url = "sqlite:///home/curve/.curveadm/data/curveadm.db"

Variables

This section is empty.

Functions

func ReplaceGlobals added in v0.1.0

func ReplaceGlobals(cfg *CurveAdmConfig)

Types

type CurveAdm added in v0.1.0

type CurveAdm struct {
	Defaults       map[string]interface{} `mapstructure:"defaults"`
	SSHConnections map[string]interface{} `mapstructure:"ssh_connections"`
	DataBase       map[string]interface{} `mapstructure:"database"`
}

type CurveAdmConfig

type CurveAdmConfig struct {
	LogLevel    string
	SudoAlias   string
	Engine      string
	Timeout     int
	AutoUpgrade bool
	SSHRetries  int
	SSHTimeout  int
	DBUrl       string
}
var (
	GlobalCurveAdmConfig *CurveAdmConfig

	SUPPORT_LOG_LEVEL = map[string]bool{
		"debug": true,
		"info":  true,
		"warn":  true,
		"error": true,
	}
)

func ParseCurveAdmConfig

func ParseCurveAdmConfig(filename string) (*CurveAdmConfig, error)

func (*CurveAdmConfig) GetAutoUpgrade added in v0.2.0

func (cfg *CurveAdmConfig) GetAutoUpgrade() bool

func (*CurveAdmConfig) GetDBPath added in v0.3.0

func (cfg *CurveAdmConfig) GetDBPath() string

func (*CurveAdmConfig) GetDBUrl added in v0.3.0

func (cfg *CurveAdmConfig) GetDBUrl() string

func (*CurveAdmConfig) GetEngine added in v0.3.0

func (cfg *CurveAdmConfig) GetEngine() string

func (*CurveAdmConfig) GetLogLevel added in v0.1.0

func (cfg *CurveAdmConfig) GetLogLevel() string

func (*CurveAdmConfig) GetSSHRetries added in v0.1.0

func (cfg *CurveAdmConfig) GetSSHRetries() int

func (*CurveAdmConfig) GetSSHTimeout

func (cfg *CurveAdmConfig) GetSSHTimeout() int

func (*CurveAdmConfig) GetSudoAlias

func (cfg *CurveAdmConfig) GetSudoAlias() string

func (*CurveAdmConfig) GetTimeout added in v0.1.0

func (cfg *CurveAdmConfig) GetTimeout() int

Jump to

Keyboard shortcuts

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