Documentation
¶
Overview ¶
Package deploystack provides a series of interfaces for getting Google Cloud settings and configurations for use with DeplyStack
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrConfigNotExist = fmt.Errorf("could not file and parse a config file")
Functions ¶
func CacheContact ¶ added in v1.1.0
func CacheContact(i interface{})
CacheContact writes a file containg domain registar contact info to disk if it exists
func CheckForContact ¶ added in v1.1.0
func CheckForContact() gcloud.ContactData
CheckForContact checks the local file system for a file containg domain registar contact info
func NewContactDataFromFile ¶ added in v1.1.0
func NewContactDataFromFile(file string) (gcloud.ContactData, error)
NewContactDataFromFile generates a new ContactData from a cached yaml file
Types ¶
type Config ¶
type Config struct {
Title string `json:"title" yaml:"title"`
Name string `json:"name" yaml:"name"`
Description string `json:"description" yaml:"description"`
Duration int `json:"duration" yaml:"duration"`
Project bool `json:"collect_project" yaml:"collect_project"`
ProjectNumber bool `json:"collect_project_number" yaml:"collect_project_number"`
BillingAccount bool `json:"collect_billing_account" yaml:"collect_billing_account"`
Domain bool `json:"register_domain" yaml:"register_domain"`
Region bool `json:"collect_region" yaml:"collect_region"`
RegionType string `json:"region_type" yaml:"region_type"`
RegionDefault string `json:"region_default" yaml:"region_default"`
Zone bool `json:"collect_zone" yaml:"collect_zone"`
HardSet map[string]string `json:"hard_settings" yaml:"hard_settings"`
CustomSettings []Custom `json:"custom_settings" yaml:"custom_settings"`
ConfigureGCEInstance bool `json:"configure_gce_instance" yaml:"configure_gce_instance"`
DocumentationLink string `json:"documentation_link" yaml:"documentation_link"`
PathTerraform string `json:"path_terraform" yaml:"path_terraform"`
PathMessages string `json:"path_messages" yaml:"path_messages"`
PathScripts string `json:"path_scripts" yaml:"path_scripts"`
Projects Projects `json:"projects" yaml:"projects"`
Products []struct {
Info string `json:"info" yaml:"info"`
Product string `json:"product" yaml:"product"`
} `json:"products" yaml:"products"`
}
Config represents the settings this app will collect from a user. It should be in a json file. The idea is minimal programming has to be done to setup a DeployStack and export out a tfvars file for terraform part of solution.
func NewConfigJSON ¶
NewConfigJSON returns a Config object from a file read.
func NewConfigYAML ¶
NewConfigYAML returns a Config object from a file read.
func (*Config) ComputeName ¶
ComputeName uses the git repo in the working directory to compute the shortname for the application.
type Custom ¶
type Custom struct {
Name string `json:"name" yaml:"name"`
Description string `json:"description" yaml:"description"`
Default string `json:"default" yaml:"default"`
Value string `json:"value" yaml:"value"`
Options []string `json:"options" yaml:"options"`
PrependProject bool `json:"prepend_project" yaml:"prepend_project"`
Validation string `json:"validation,omitempty" yaml:"validation,omitempty"`
// contains filtered or unexported fields
}
Custom represents a custom setting that we would like to collect from a user We will collect these settings from the user before continuing.
type Project ¶
type Project struct {
Name string `json:"variable_name" yaml:"variable_name"`
UserPrompt string `json:"user_prompt" yaml:"user_prompt"`
SetAsDefault bool `json:"set_as_default" yaml:"set_as_default"`
// contains filtered or unexported fields
}
Project represets a GCP project for use in a stack
type Projects ¶
type Projects struct {
Items []Project `json:"items" yaml:"items"`
AllowDuplicates bool `json:"allow_duplicates" yaml:"allow_duplicates"`
}
Projects is a list of projects that we will collect info for
type Stack ¶
Stack represents the input config and output settings for this DeployStack
func Init ¶ added in v1.1.0
Init initializes a Deploystack stack by looking on teh local file system
func (Stack) AddSetting ¶
AddSetting stores a setting key/value pair.
func (Stack) DeleteSetting ¶
DeleteSetting removes a setting value.
func (*Stack) FindAndReadRequired ¶
FindAndReadRequired finds and reads in a Config from a json file.
func (Stack) GetSetting ¶
GetSetting returns a setting value.
func (Stack) TerraformFile ¶
TerraformFile exports TFVars format to input file.






