config

package
v0.0.0-...-f17ef4b Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WorkerSizes = []string{"medium", "large", "xlarge"}

WorkerSizes are the permitted concourse worker sizes

Functions

This section is empty.

Types

type Client

type Client struct {
	Project string
}

Client is a client for loading the config file from S3

func (*Client) DeleteAll

func (client *Client) DeleteAll(config *Config) error

DeleteAll deletes the entire configuration bucket

func (*Client) DeleteAsset

func (client *Client) DeleteAsset(filename string) error

DeleteAsset deletes an associated configuration file

func (*Client) HasAsset

func (client *Client) HasAsset(filename string) (bool, error)

HasAsset returns true if an associated configuration file exists

func (*Client) Load

func (client *Client) Load() (*Config, error)

Load loads an existing config file from S3

func (*Client) LoadAsset

func (client *Client) LoadAsset(filename string) ([]byte, error)

LoadAsset loads an associated configuration file

func (*Client) LoadOrCreate

func (client *Client) LoadOrCreate(deployArgs *DeployArgs) (*Config, bool, error)

LoadOrCreate loads an existing config file from S3, or creates a default if one doesn't already exist

func (*Client) StoreAsset

func (client *Client) StoreAsset(filename string, contents []byte) error

StoreAsset stores an associated configuration file

func (*Client) Update

func (client *Client) Update(config *Config) error

Update stores the conconcourse up config file to S3

type Config

type Config struct {
	HostedZoneID           string `json:"hosted_zone_id"`
	HostedZoneRecordPrefix string `json:"hosted_zone_record_prefix"`
	Domain                 string `json:"domain"`

	ConcourseUsername        string `json:"concourse_username"`
	ConcoursePassword        string `json:"concourse_password"`
	ConcourseWorkerCount     int    `json:"concourse_worker_count"`
	ConcourseWorkerSize      string `json:"concourse_worker_size"`
	ConcourseDBName          string `json:"concourse_db_name"`
	PublicKey                string `json:"public_key"`
	PrivateKey               string `json:"private_key"`
	Region                   string `json:"region"`
	AvailabilityZone         string `json:"availability_zone"`
	Deployment               string `json:"deployment"`
	RDSDefaultDatabaseName   string `json:"rds_default_database_name"`
	SourceAccessIP           string `json:"source_access_ip"`
	TFStatePath              string `json:"tf_state_path"`
	Project                  string `json:"project"`
	ConfigBucket             string `json:"config_bucket"`
	DirectorUsername         string `json:"director_username"`
	DirectorPassword         string `json:"director_password"`
	DirectorHMUserPassword   string `json:"director_hm_user_password"`
	DirectorMbusPassword     string `json:"director_mbus_password"`
	DirectorNATSPassword     string `json:"director_nats_password"`
	DirectorRegistryPassword string `json:"director_registry_password"`
	DirectorCACert           string `json:"director_ca_cert"`
	DirectorCert             string `json:"director_cert"`
	DirectorKey              string `json:"director_key"`
	DirectorPublicIP         string `json:"director_public_ip"`

	ConcourseCert             string `json:"concourse_cert"`
	ConcourseKey              string `json:"concourse_key"`
	ConcourseCACert           string `json:"concourse_ca_cert"`
	ConcourseUserProvidedCert bool   `json:"concourse_user_provided_cert"`

	RDSInstanceClass string `json:"rds_instance_class"`
	RDSUsername      string `json:"rds_username"`
	RDSPassword      string `json:"rds_password"`
	MultiAZRDS       bool   `json:"multi_az_rds"`
}

Config represents a concourse-up configuration file

type DeployArgs

type DeployArgs struct {
	AWSRegion   string
	Domain      string
	TLSCert     string
	TLSKey      string
	WorkerCount int
	WorkerSize  string
}

DeployArgs are arguments passed to the deploy command

func (DeployArgs) Validate

func (args DeployArgs) Validate() error

Validate validates that flag interdependencies

type IClient

type IClient interface {
	Load() (*Config, error)
	DeleteAll(config *Config) error
	LoadOrCreate(deployArgs *DeployArgs) (*Config, bool, error)
	Update(*Config) error
	StoreAsset(filename string, contents []byte) error
	HasAsset(filename string) (bool, error)
	LoadAsset(filename string) ([]byte, error)
	DeleteAsset(filename string) error
}

IClient is an interface for the config file client

Jump to

Keyboard shortcuts

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