config

package
v0.0.0-...-6116186 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultEnvironment = "unspecified"
	DefaultAccount     = "677459762413"
	DefaultRegion      = "us-west-2"
)
View Source
const GoCobraCliName = "go-cobra-cli"
View Source
const GoLambdaName = "go-lambda"
View Source
const TerraformModuleName = "terraform-module"
View Source
const TerraformName = "terraform"

Variables

View Source
var (
	ErrUnsupportedFileType = errors.New("unsupported config file type")
	ErrUnsupportedTemplate = errors.New("unsupported template selected")
)
View Source
var Debug bool = false

Functions

func FindConfigPath

func FindConfigPath() string

Types

type Config

type Config struct {
	Name       string                 `json:"name" yaml:"name"`
	Template   string                 `json:"template" yaml:"template"`
	Parameters map[string]interface{} `json:"parameters" yaml:"parameters"`
}
var Cfg Config

func New

func New(configPath string) (Config, error)

func (Config) GetTemplater

func (c Config) GetTemplater() (Templater, error)

type DeployConfig

type DeployConfig struct {
	// Environment is the name of the environment to deploy to.
	Environment string `json:"environment" yaml:"environment"`

	// Account is the AWS account ID used to deploy to this environment.
	Account string `json:"account,omitempty" yaml:"account,omitempty"`

	// RoleARN is the ARN of the role used to deploy to this environment.
	RoleARN string `json:"roleArn,omitempty" yaml:"roleArn,omitempty"`

	// Region is the AWS region this environment will be deployed into.
	Region string `json:"region,omitempty" yaml:"region,omitempty"`

	// If is the value of the `if` field for the GitHub Actions job that will
	// deploy this application.
	If string `json:"if,omitempty" yaml:"if,omitempty"`
}

func (*DeployConfig) UnmarshalJSON

func (c *DeployConfig) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the JSON blob while adding default values contextually

type GitHubConfig

type GitHubConfig struct {
	Action GitHubConfigAction `json:"action,omitempty" yaml:"action,omitempty"`
	Env    map[string]string  `json:"env,omitempty" yaml:"env,omitempty"`
	RunsOn string             `json:"runsOn,omitempty" yaml:"runsOn,omitempty"`
}

func NewGitHubConfig

func NewGitHubConfig() GitHubConfig

type GitHubConfigAction

type GitHubConfigAction struct {
	SetupDeployKey bool `json:"setupDeployKey,omitempty" yaml:"setupDeployKey,omitempty"`
	SetupNix       bool `json:"setupNix,omitempty" yaml:"setupNix,omitempty"`
}

func NewGitHubConfigAction

func NewGitHubConfigAction() GitHubConfigAction

type GoCobraCliConfig

type GoCobraCliConfig struct {
	Config
	CgoEnabled     bool               `json:"cgoEnabled,omitempty" yaml:"cgoEnabled,omitempty"`
	GoVersion      string             `json:"goVersion,omitempty" yaml:"goVersion,omitempty"`
	Lint           GolangCILintConfig `json:"lint,omitempty" yaml:"lint,omitempty"`
	Nix            NixGoConfig        `json:"nix,omitempty" yaml:"nix,omitempty"`
	PrivateModules string             `json:"privateModules,omitempty" yaml:"privateModules,omitempty"`
	Version        string             `json:"version,omitempty" yaml:"version,omitempty"`
}

func NewGoCobraCliConfig

func NewGoCobraCliConfig(c Config) GoCobraCliConfig

func (GoCobraCliConfig) Render

func (c GoCobraCliConfig) Render() error

type GoLambdaConfig

type GoLambdaConfig struct {
	Config
	GoVersion      string             `json:"goVersion,omitempty" yaml:"goVersion,omitempty"`
	Lint           GolangCILintConfig `json:"lint,omitempty" yaml:"lint,omitempty"`
	Nix            NixGoConfig        `json:"nix,omitempty" yaml:"nix,omitempty"`
	Quirk          QuirkConfig        `json:"quirk,omitempty" yaml:"quirk,omitempty"`
	Deploy         []DeployConfig     `json:"deploy,omitempty" yaml:"deploy,omitempty"`
	PrivateModules string             `json:"privateModules,omitempty" yaml:"privateModules,omitempty"`
	Lambdas        []string           `json:"lambdas,omitempty" yaml:"lambdas,omitempty"`
	OpenAPI        OpenAPIConfig      `json:"openapi,omitempty" yaml:"openapi,omitempty"`
}

func NewGoLambdaConfig

func NewGoLambdaConfig(c Config) GoLambdaConfig

func (GoLambdaConfig) Render

func (c GoLambdaConfig) Render() error

type GolangCILintConfig

type GolangCILintConfig struct {
	Exclude      []string `json:"exclude,omitempty" yaml:"exclude,omitempty"`
	ExtraExclude []string `json:"extraExclude,omitempty" yaml:"extraExclude,omitempty"`
}

func NewGolangCiLintConfig

func NewGolangCiLintConfig() GolangCILintConfig

type NixCachixConfig

type NixCachixConfig struct {
	BinaryCache string `json:"binaryCache,omitempty" yaml:"binaryCache,omitempty"`
}

type NixConfig

type NixConfig struct {
	Cachix        NixCachixConfig `json:"cachix,omitempty" yaml:"cachix,omitempty"`
	NixpkgsBranch string          `json:"nixpkgsBranch,omitempty" yaml:"nixpkgsBranch,omitempty"`
	Systems       []string        `json:"systems,omitempty" yaml:"systems,omitempty"`
}

func NewNixConfig

func NewNixConfig() NixConfig

type NixGoConfig

type NixGoConfig struct {
	NixConfig
	GoPackage     string `json:"goPackage,omitempty" yaml:"goPackage,omitempty"`
	BuildGoModule string `json:"buildGoModule,omitempty" yaml:"buildGoModule,omitempty"`
	VendorHash    string `json:"vendorHash,omitempty" yaml:"vendorHash,omitempty"`
}

type OpenAPIConfig

type OpenAPIConfig struct {
	Enable   bool   `json:"enable" yaml:"enable"`
	Filename string `json:"filename" yaml:"filename"`
}

func NewOpenAPIConfig

func NewOpenAPIConfig() OpenAPIConfig

type QuirkConfig

type QuirkConfig struct {
	Service string `json:"service,omitempty" yaml:"service,omitempty"`
}

func NewQuirkConfig

func NewQuirkConfig(c Config) QuirkConfig

type Templater

type Templater interface {
	Render() error
}

type TerraformConfig

type TerraformConfig struct {
	Config
	GitHub    GitHubConfig        `json:"github,omitempty" yaml:"github,omitempty"`
	Nix       NixConfig           `json:"nix,omitempty" yaml:"nix,omitempty"`
	Region    string              `json:"region,omitempty" yaml:"region,omitempty"`
	Role      TerraformConfigRole `json:"role,omitempty" yaml:"role,omitempty"`
	Schedule  *string             `json:"schedule,omitempty" yaml:"schedule,omitempty"`
	Providers []string            `json:"providers,omitempty" yaml:"providers,omitempty"`
}

func NewTerraformConfig

func NewTerraformConfig(c Config) TerraformConfig

func (TerraformConfig) Render

func (c TerraformConfig) Render() error

type TerraformConfigRole

type TerraformConfigRole struct {
	PlanARN  string `json:"planArn,omitempty" yaml:"planArn,omitempty"`
	ApplyARN string `json:"applyArn,omitempty" yaml:"applyArn,omitempty"`
}

func NewTerraformConfigRole

func NewTerraformConfigRole(name string) TerraformConfigRole

type TerraformModuleConfig

type TerraformModuleConfig struct {
	Config
	Nix       NixConfig `json:"nix,omitempty" yaml:"nix,omitempty"`
	Providers []string  `json:"providers,omitempty" yaml:"providers,omitempty"`
}

func NewTerraformModuleConfig

func NewTerraformModuleConfig(c Config) TerraformModuleConfig

func (TerraformModuleConfig) Render

func (c TerraformModuleConfig) Render() error

Jump to

Keyboard shortcuts

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