stacks

package
v0.0.0-...-1b0671e Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Copyright 2016 Capital One Services, LLC

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

SPDX-Copyright: Copyright (c) Capital One Services, LLC SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

SPDX-Copyright: Copyright (c) Capital One Services, LLC SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

SPDX-Copyright: Copyright (c) Capital One Services, LLC SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

SPDX-Copyright: Copyright (c) Capital One Services, LLC SPDX-License-Identifier: Apache-2.0

Index

Constants

View Source
const (
	TEMPLATE_CTX_KEY = "_templateCtx"
)

Variables

This section is empty.

Functions

func EnvKeys

func EnvKeys() (result []string)

func EnvValueMap

func EnvValueMap(keys ...string) map[string]interface{}

func GetenvFunc

func GetenvFunc(key string) func(*raymond.Options) string

func HelperCtx

func HelperCtx(options *raymond.Options, helperCmd string) interface{}

func RegisterTemplateHelper

func RegisterTemplateHelper(cmd string, ctx interface{}, helper interface{})

Types

type AWSStackApi

type AWSStackApi struct {
	providers.AWSApi
}

func NewAWSStackApi

func NewAWSStackApi(api *providers.AWSApi) *AWSStackApi

func (*AWSStackApi) CreateOrUpdateStacks

func (a *AWSStackApi) CreateOrUpdateStacks(envStacks *EnvStacksConfig)

func (*AWSStackApi) DeleteStacks

func (a *AWSStackApi) DeleteStacks(envStacks *EnvStacksConfig)

func (*AWSStackApi) FindDeploymentOutput

func (a *AWSStackApi) FindDeploymentOutput(stackName string, outputKey string) (string, error)

func (*AWSStackApi) FindStack

func (a *AWSStackApi) FindStack(stackName string) *cloudformation.Stack

func (*AWSStackApi) PrintChangesToStacks

func (a *AWSStackApi) PrintChangesToStacks(envStacks *EnvStacksConfig)

func (*AWSStackApi) StacksStatus

func (a *AWSStackApi) StacksStatus(envStacks *EnvStacksConfig)

type DeploymentOutputFinder

type DeploymentOutputFinder interface {
	FindDeploymentOutput(stackName string, outputKey string) (string, error)
}

type EnvStacksConfig

type EnvStacksConfig struct {
	Yaml        map[string]interface{} // scoped yaml to the env
	Env         string
	StackLabels []string
	Stacks      map[string]StackConfig // stack id to stackconfig mapping
	Config      *StacksConfig
}

func (*EnvStacksConfig) Fetch

func (e *EnvStacksConfig) Fetch(item string) interface{}

func (*EnvStacksConfig) FetchAll

func (e *EnvStacksConfig) FetchAll() interface{}

func (*EnvStacksConfig) Stack

func (e *EnvStacksConfig) Stack(stackLabel string) *StackConfig

type Fetcher

type Fetcher interface {
	Fetch(item string) interface{}
	FetchJsonPtr(jsonPtr string) interface{}
	FetchAll() interface{}
}

type LabeledVertex

type LabeledVertex interface {
	Label() string
}

type ScriptRunnerStackProxy

type ScriptRunnerStackProxy struct {
	// contains filtered or unexported fields
}

func (*ScriptRunnerStackProxy) CreateOrUpdateStacks

func (p *ScriptRunnerStackProxy) CreateOrUpdateStacks(envStacks *EnvStacksConfig)

func (*ScriptRunnerStackProxy) DeleteStacks

func (p *ScriptRunnerStackProxy) DeleteStacks(envStacks *EnvStacksConfig)

func (*ScriptRunnerStackProxy) DryMode

func (p *ScriptRunnerStackProxy) DryMode(enable bool)

func (*ScriptRunnerStackProxy) FindDeploymentOutput

func (p *ScriptRunnerStackProxy) FindDeploymentOutput(stackName string, outputKey string) (string, error)

func (*ScriptRunnerStackProxy) PrintChangesToStacks

func (p *ScriptRunnerStackProxy) PrintChangesToStacks(envStacks *EnvStacksConfig)

func (*ScriptRunnerStackProxy) StacksStatus

func (p *ScriptRunnerStackProxy) StacksStatus(envStacks *EnvStacksConfig)

type StackApi

type StackApi interface {
	DeploymentOutputFinder
	CreateOrUpdateStacks(envStacks *EnvStacksConfig)
	DeleteStacks(envStacks *EnvStacksConfig)
	StacksStatus(envStacks *EnvStacksConfig)
	PrintChangesToStacks(envStacks *EnvStacksConfig)

	DryMode(enable bool)
}

func DefaultStackApi

func DefaultStackApi() StackApi

func GetStackApi

func GetStackApi(stackType string) StackApi

type StackConfig

type StackConfig struct {
	Yaml map[string]interface{} // scoped yaml to the stack

	Config *StacksConfig
	// contains filtered or unexported fields
}

func (*StackConfig) Fetch

func (s *StackConfig) Fetch(item string) interface{}

func (*StackConfig) FetchAll

func (s *StackConfig) FetchAll() interface{}

func (*StackConfig) Hashcode

func (s *StackConfig) Hashcode() interface{}

func (*StackConfig) Label

func (s *StackConfig) Label() string

func (*StackConfig) Name

func (s *StackConfig) Name() string

type StacksConfig

type StacksConfig struct {
	Yaml     map[string]interface{}
	Templ    *Template
	FileName string
}

func NewConfig

func NewConfig(yamlFilePath string, outputFinder DeploymentOutputFinder) (c *StacksConfig)

func (*StacksConfig) Fetch

func (c *StacksConfig) Fetch(item string) interface{}

func (*StacksConfig) FetchAll

func (c *StacksConfig) FetchAll() interface{}

func (*StacksConfig) FetchEnvStacks

func (c *StacksConfig) FetchEnvStacks(stackRef string) *EnvStacksConfig

"build.nagios-elb" or "build[nagios-elb,nagios-app]"

or just "build" - which implies all stacks

func (*StacksConfig) FetchJsonPtr

func (c *StacksConfig) FetchJsonPtr(jsonPtr string) interface{}

func (*StacksConfig) ProcessValue

func (s *StacksConfig) ProcessValue(val interface{}) interface{}

type Template

type Template struct {
	OutputFinder DeploymentOutputFinder
	YamlFetcher  Fetcher
	HelpersCtx   map[string]interface{} // helper -> ctx
}

func CtxTemplate

func CtxTemplate(options *raymond.Options) *Template

func NewTemplate

func NewTemplate(outputFinder DeploymentOutputFinder, yamlFetcher Fetcher) *Template

TODO: move these to render?

func (*Template) Render

func (t *Template) Render(input string) string

Jump to

Keyboard shortcuts

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