Documentation ¶
Index ¶
Constants ¶
const DefaultConfigName = "sparta.yml"
the default file name of the configuration file
const ViperS3Key = "s3key"
viper keys for configuration to be passed in
const ViperS3Region = "s3region"
const ViperS3Secret = "s3secret"
const ViperS3Url = "s3url"
Variables ¶
This section is empty.
Functions ¶
func WriteConfig ¶
func WriteConfig(config SpartaConfig, fullPath string) error
Types ¶
type Cloud ¶
type Cloud struct { Provider string Region string VpcId string `mapstructure:"vpc-id"` CidrPrivate string `mapstructure:"cidr-private"` }
Cloud is information on the target cloud environment and the VPCs that
are created there
type Cluster ¶
type Cluster struct { Target string VpcName string `mapstructure:"vpc-name"` ClusterName string `mapstructure:"cluster-name"` BaseDomain string `mapstructure:"base-domain"` ClusterDomain string `mapstructure:"cluster-domain"` AmiId string `mapstructure:"ami-id"` }
Cluster defines the cluster logical details like names and networking
type EnvironmentVariable ¶
An EnvironmentVariable is a struct that holds a name/value pair because a straight-up map[string]string
can't be used since viper keys are case insensitive and will be all lower case in the map resulting to unexpected behavior in the plugin see: https://github.com/spf13/viper/issues/411 and: https://github.com/spf13/viper/issues/373
func (EnvironmentVariable) Pair ¶
func (env EnvironmentVariable) Pair() string
Pair converts the name/value into the name=value format that is expected
when the command is being run
type EnvironmentVariables ¶
type EnvironmentVariables []EnvironmentVariable
EnvironmentVariables is a slice of name->values that is used to send environment
to the execution of a plugin. This is used in place of a map because viper keys are case-insensitive and the resulting map would all be lowercase
func (EnvironmentVariables) List ¶
func (vars EnvironmentVariables) List() []string
List creates a slice of "name=value" pairs that is suitable for use with the
plugin command.
func (EnvironmentVariables) Map ¶
func (vars EnvironmentVariables) Map() map[string]string
Map creates a map of values matching the map[name]value structure
type OpenShift ¶
type OpenShift struct {
Version string
}
OpenShift defines the openshift configuration details related to artifacts and sources
type Plugin ¶
type Plugin struct { Version string Service string Organization string Branch string Env EnvironmentVariables }
Plugin is a struct that defines details about a Koffer plugin, it's
source, version, and other details for Koffer to collect
type ProviderAuth ¶
ProviderAuth is the authentication structure for the provider (such as AWS)
type SpartaConfig ¶
type SpartaConfig struct { OpenShift OpenShift Cluster Cluster Cloud Cloud Subnets Subnets ProviderAuth ProviderAuth `mapstructure:"provider-auth"` RedSord RedSord Koffer Koffer }
SpartaConfig is the holder for all of the parts of the configuration
func DefaultConfig ¶
func DefaultConfig() SpartaConfig
DefaultConfig creates a default configuration where any values that
need to default to "non-empty" values (like booleans) or strings can be set and so that the maps and arrays are already constructed to prevent issues with unsafe reads of the configuration
func NewSpartaConfig ¶
func NewSpartaConfig(configUrl string, searchPaths ...string) (*SpartaConfig, error)
NewSpartaConfig creates a configuration from the given file name and searches
the list of locations for that file.
func ViperSpartaConfig ¶
func ViperSpartaConfig(viperInstance *viper.Viper, configUrl string, searchPaths ...string) (*SpartaConfig, error)
ViperSpartaConfig takes a viper instance, configures it for Sparta configuration using the given paths and search
location and loads the values into the viper instance as well as returning the configuration
type Subnets ¶
type Subnets map[string]SubnetGroup
Subnets is a map of names (private/public) to a list of subnet ids (SubnetGroup) found
in that subnet name