Documentation
¶
Index ¶
- func AwsConfigFile(accountName string, region string) string
- func AwsConfigFileRead() string
- func AwsCredentialsFile(accountName string, accessKeyID string, secretAccessKey string, ...) string
- func AwsCredsFileRead() string
- func AwsReplaceBlock(file string, accountName string) string
- func CacheFileExists() bool
- func CacheFileRead() string
- func CheckAndReturnError(err error)
- func CheckConfigFile(path string) bool
- func CommandExists(command string)
- func ConfigFileResultString(field string) string
- func GetHomeDirectory() string
- func TemplateCacheFile(accountName string, accountID int, accountRole []string, ...) string
- func TemplateConfigFile() string
- type CacheFields
- type GeneralParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AwsConfigFile ¶
this function marshalls data into a file
func AwsCredentialsFile ¶
func AwsCredentialsFile(accountName string, accessKeyID string, secretAccessKey string, sessionToken string) string
this function marshalls data into a toml file
func AwsReplaceBlock ¶
this function replaces within a file the block of text which matches the accountName input variable
func CheckAndReturnError ¶
func CheckAndReturnError(err error)
this function checks the error, if the error contains a message, stop the execution and show the error to the user
func CheckConfigFile ¶
this function verifies the config file integrity
func ConfigFileResultString ¶
this function parsers the struct and returns one field (string only) at a time
func GetHomeDirectory ¶
func GetHomeDirectory() string
this function returns the caller $HOME directory
func TemplateCacheFile ¶
func TemplateCacheFile(accountName string, accountID int, accountRole []string, accountRegion []string) string
this function marshalls data into a toml file (.letme-cache)
func TemplateConfigFile ¶
func TemplateConfigFile() string
this function marshalls data into a toml file (letme-config)
Types ¶
type CacheFields ¶
type CacheFields struct { Id int `toml:"id"` Name string `toml:"name"` Role []string `toml:"role"` Region []string `toml:"region"` }
struct to parse cache data
func ParseCacheFile ¶
func ParseCacheFile(account string) CacheFields
this function maps data on the cache file into a struct
type GeneralParams ¶
type GeneralParams struct { Aws_source_profile string Aws_source_profile_region string `toml:"aws_source_profile_region,omitempty"` Dynamodb_table string Mfa_arn string `toml:"mfa_arn,omitempty"` Session_name string }
struct to unmarshal toml (will be modified as new options are demanded)