cfg

package
v0.0.0-...-8353e37 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2020 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(cfgFile string)

Init prepares the configuration and reads it

func SaveTkn

func SaveTkn(tkn string, expiresAt time.Time) error

SaveTkn saves the token to the configuration file

func SetDefaults

func SetDefaults()

SetDefaults sets the default configurations for Viper

Types

type DRLMCtlConfig

type DRLMCtlConfig struct {
	Core        DRLMCtlCoreConfig     `mapstructure:"core"`
	PluginRepos map[string]PluginRepo `mapstructure:"plugin_repos"`
	Log         logger.Config         `mapstructure:"log"`
}

DRLMCtlConfig is the configuration of the CLI tool of DRLM

var Config *DRLMCtlConfig

Config has the values of the user configuration

func (*DRLMCtlConfig) Save

func (c *DRLMCtlConfig) Save() error

Save writes the current configuration to the configuration file

type DRLMCtlCoreConfig

type DRLMCtlCoreConfig struct {
	Host          string    `mapstructure:"host"`
	Port          int       `mapstructure:"port"`
	SSHPort       int       `mapstructure:"ssh_port"`
	SSHKeys       []string  `mapstructure:"ssh_keys"`
	OS            os.OS     `mapstructure:"os"`
	Arch          os.Arch   `mapstructure:"arch"`
	TLS           bool      `mapstructure:"tls"`
	CertPath      string    `mapstructure:"cert_path"`
	Tkn           string    `mapstructure:"tkn"`
	TknExpiration time.Time `mapstructure:"tkn_expiration"`
}

DRLMCtlCoreConfig is the configuration related with the DRLM Core of the CLI tool of DRLM

type PluginRepo

type PluginRepo struct {
	URL string `mapstructure:"url"`
	Usr string `mapstructure:"usr"`
	Pwd string `mapstructure:"pwd"`
}

PluginRepo is a DRLM plugin repository

Jump to

Keyboard shortcuts

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