config

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package config store all necessary configuration parameters for the project.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Default

func Default()

Default defines all default configuration values.

func LoadFromEnvironment

func LoadFromEnvironment() error

LoadFromEnvironment analysis all project environment variables.

func LoadFromFile

func LoadFromFile(filename string) error

LoadFromFile parse an YAML file and fill the system configuration parameters.

func PasswordEncrypt

func PasswordEncrypt(input string) (string, error)

PasswordEncrypt uses the secret to encode the password.

func Update

func Update(c *Config)

Update modify the current system configuration.

Types

type Config

type Config struct {
	Paths       []string `yaml:"paths" envconfig:"paths"`
	AuditFile   string   `yaml:"audit file" envconfig:"audit"`
	KeepBackups int      `yaml:"keep backups" envconfig:"keep_backups"`
	AWS         struct {
		AccountID       encrypted `yaml:"account id" envconfig:"account_id"`
		AccessKeyID     encrypted `yaml:"access key id" envconfig:"access_key_id"`
		SecretAccessKey encrypted `yaml:"secret access key" envconfig:"secret_access_key"`
		Region          string    `yaml:"region" envconfig:"region"`
		VaultName       string    `yaml:"vault name" envconfig:"vault_name"`
	} `yaml:"aws" envconfig:"aws"`
}

Config stores all the necessary information to send backups to the cloud and keep track in the local storage.

func Current

func Current() *Config

Current return the actual system configuration, stored internally in a global variable.

Jump to

Keyboard shortcuts

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