config

package
v0.0.0-...-2380f63 Latest Latest
Warning

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

Go to latest
Published: May 10, 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"

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 GoCobraCliConfig

type GoCobraCliConfig 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"`
	PrivateModules string             `json:"privateModules,omitempty" yaml:"privateModules,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
}

Jump to

Keyboard shortcuts

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