conf

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

README

conf

Why not call this thing config? Because you end up calling your variables something weird like cfg or conf.

It's better to have an abbreviated package name than abbreviated variables.

Documentation

Overview

Changing configuration fields or semantics? Make sure to update commands/help/files/config.go as well

Index

Constants

View Source
const (
	Topology_Inet   = "inet"
	Topology_Worker = "worker"
	Topology_Cron   = "cron"
)

Variables

This section is empty.

Functions

func ValidateRegion

func ValidateRegion(region *Region, validateRoleArn bool) error

Types

type AvailabilityZone

type AvailabilityZone struct {
	Name     string `yaml:"name"`
	SubnetID string `yaml:"subnet_id"`
}

type BlackoutWindow

type BlackoutWindow struct {
	StartTime string `yaml:"start_time"`
	EndTime   string `yaml:"end_time"`
}

type Config

type Config struct {
	ServiceName   string         `yaml:"service_name"`
	PorterVersion string         `yaml:"porter_version"`
	Environments  []*Environment `yaml:"environments"`
	Slack         Slack          `yaml:"slack"`
	Hooks         Hooks          `yaml:"hooks"`
}

Config supports multi-container deployments

func GetAlteredConfig

func GetAlteredConfig(log log15.Logger) (*Config, bool)

func GetConfig

func GetConfig(log log15.Logger) (*Config, bool)

func GetStdinConfig

func GetStdinConfig(log log15.Logger) (*Config, bool)

func (*Config) GetEnvironment

func (recv *Config) GetEnvironment(envName string) (*Environment, error)

func (*Config) Print

func (recv *Config) Print()

func (*Config) SetDefaults

func (recv *Config) SetDefaults()

Convention over configuration

func (*Config) Validate

func (recv *Config) Validate() (err error)

func (*Config) ValidateEnvironments

func (recv *Config) ValidateEnvironments() error

func (*Config) ValidateTopLevelKeys

func (recv *Config) ValidateTopLevelKeys() error

type Container

type Container struct {
	Name        string       `yaml:"name"`
	Topology    string       `yaml:"topology"`
	InetPort    int          `yaml:"inet_port"`
	Primary     bool         `yaml:"primary"`
	Uid         *int         `yaml:"uid"`
	HealthCheck *HealthCheck `yaml:"health_check"`
	SrcEnvFile  *SrcEnvFile  `yaml:"src_env_file"`
	DstEnvFile  *DstEnvFile  `yaml:"dst_env_file"`
}

type DstEnvFile

type DstEnvFile struct {
	S3Bucket string `yaml:"s3_bucket"`
	KMSARN   string `yaml:"kms_arn"`
}

type ELB

type ELB struct {
	ELBTag string `yaml:"tag"`
	Name   string `yaml:"name"`
}

type Environment

type Environment struct {
	Name                string           `yaml:"name"`
	StackDefinitionPath string           `yaml:"stack_definition_path"`
	RoleARN             string           `yaml:"role_arn"`
	InstanceCount       uint             `yaml:"instance_count"`
	InstanceType        string           `yaml:"instance_type"`
	BlackoutWindows     []BlackoutWindow `yaml:"blackout_windows"`
	Regions             []*Region        `yaml:"regions"`
}

func (*Environment) GetELBForRegion

func (recv *Environment) GetELBForRegion(reg string, elb string) (string, error)

func (*Environment) GetRegion

func (recv *Environment) GetRegion(regionName string) (*Region, error)

func (*Environment) GetRoleARN

func (recv *Environment) GetRoleARN(regionName string) (string, error)

func (Environment) GetStackDefinitionPath

func (recv Environment) GetStackDefinitionPath(regionName string) (string, error)

func (*Environment) IsWithinBlackoutWindow

func (recv *Environment) IsWithinBlackoutWindow() error

type HealthCheck

type HealthCheck struct {
	Method string `yaml:"method"`
	Path   string `yaml:"path"`
}

type Hook

type Hook struct {
	Repo       string `yaml:"repo"`
	Ref        string `yaml:"ref"`
	Dockerfile string `yaml:"dockerfile"`
}

type Hooks

type Hooks struct {
	PrePack       []Hook `yaml:"pre_pack"`
	PostPack      []Hook `yaml:"post_pack"`
	PreProvision  []Hook `yaml:"pre_provision"`
	PostProvision []Hook `yaml:"post_provision"`
	PrePromote    []Hook `yaml:"pre_promote"`
	PostPromote   []Hook `yaml:"post_promote"`
	PrePrune      []Hook `yaml:"pre_prune"`
	PostPrune     []Hook `yaml:"post_prune"`
	EC2Bootstrap  []Hook `yaml:"ec2_bootstrap"`
}

type Region

type Region struct {
	Name                string             `yaml:"name"`
	StackDefinitionPath string             `yaml:"stack_definition_path"`
	VpcId               string             `yaml:"vpc_id"`
	AZs                 []AvailabilityZone `yaml:"azs"`
	ELBs                []*ELB             `yaml:"elbs"`
	ELB                 string             `yaml:"elb"`
	RoleARN             string             `yaml:"role_arn"`
	SSLCertARN          string             `yaml:"ssl_cert_arn"`
	HostedZoneName      string             `yaml:"hosted_zone_name"`
	KeyPairName         string             `yaml:"key_pair_name"`
	S3Bucket            string             `yaml:"s3_bucket"`
	Containers          []*Container       `yaml:"containers"`
}

func (*Region) PrimaryTopology

func (recv *Region) PrimaryTopology() (dominant string)

inet is a superset of worker which are almost identical to cron

func (*Region) ValidateContainers

func (recv *Region) ValidateContainers() error

type Slack

type Slack struct {
	PackSuccessHook      string `yaml:"pack_success_webhook_url"`
	PackFailureHook      string `yaml:"pack_failure_webhook_url"`
	ProvisionSuccessHook string `yaml:"provision_success_webhook_url"`
	ProvisionFailureHook string `yaml:"provision_failure_webhook_url"`
	PromoteSuccessHook   string `yaml:"promote_success_webhook_url"`
	PromoteFailureHook   string `yaml:"promote_failure_webhook_url"`
}

type SrcEnvFile

type SrcEnvFile struct {
	S3Key    string `yaml:"s3_key"`
	S3Bucket string `yaml:"s3_bucket"`
	S3Region string `yaml:"s3_region"`
}

Jump to

Keyboard shortcuts

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