config

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRdsSectionNotFound = errors.New("[rds.*] section not found in file")

ErrRdsSectionNotFound is the config file format error

Functions

func GetDefaultPath

func GetDefaultPath() string

GetDefaultPath is return default conf file path.

Types

type AWSConfig

type AWSConfig struct {
	Accesskey string `toml:"access_key"`
	SecretKey string `toml:"secret_key"`
}

AWSConfig struct is Accesskey and SecretKey variable

type Config

type Config struct {
	Aws AWSConfig
	Out OutConfig
	Rds map[string]RDSConfig
	Log LogConfig
}

Config struct is Aws AWSConfig and Out OutConfig and Rds map and Log LogConfig variable

func LoadConfig

func LoadConfig(file string) (*Config, error)

LoadConfig is the contents are loaded from "rds-try.conf" file.

func (*Config) GetAWSCreds

func (c *Config) GetAWSCreds() (*credentials.Credentials, error)

GetAWSCreds returns the appropriate value as the need arises.

evaluated in the following order 1. input variable 2. Environment variable 3. IAM Role

"/.aws/credentials" necessary item increased about that, so it isn't used.

type LogConfig

type LogConfig struct {
	Root    string `toml:"root"`
	Verbose bool   `toml:"verbose"`
	JSON    bool   `toml:"json"`
}

LogConfig struct is Root and Verbose and JSON variable

type OutConfig

type OutConfig struct {
	Root string `toml:"root"`
	File bool   `toml:"file"`
	Bom  bool   `toml:"bom"`
}

OutConfig struct is Root and File and Bom variable

type RDSConfig

type RDSConfig struct {
	MultiAz bool   `toml:"multi_az"`
	DBId    string `toml:"db_id"`
	Region  string `toml:"region"`
	User    string `toml:"user"`
	Pass    string `toml:"pass"`
	Type    string `toml:"type"`
}

RDSConfig struct is MultiAz and DBId and Region and User and Pass and Type variable

Jump to

Keyboard shortcuts

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