config

package
v0.370.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigDuplicateErrorString       = "environment variable %s has a duplicate set in environment: %s"
	ConfigRequiredErrorString        = "environment variable %s is required but not defined in the following environments: %s"
	ConfigIncorrectNamingErrorString = "%s must be written in upper snakecase"
	ConfigReservedNameErrorString    = "environment variable %s cannot start with %s as it is reserved"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct{}

Config is the configuration for the Keel runtime

type ConfigError

type ConfigError struct {
	Type    string `json:"type,omitempty"`
	Message string `json:"message,omitempty"`
}

func (ConfigError) Error

func (c ConfigError) Error() string

type ConfigErrors

type ConfigErrors struct {
	Errors []*ConfigError `json:"errors"`
}

func Validate

func Validate(config *ProjectConfig) *ConfigErrors

func (ConfigErrors) Error

func (c ConfigErrors) Error() string

type EnvironmentConfig

type EnvironmentConfig struct {
	Default     []Input `yaml:"default"`
	Development []Input `yaml:"development"`
	Staging     []Input `yaml:"staging"`
	Production  []Input `yaml:"production"`
	Test        []Input `yaml:"test"`
}

EnvironmentConfig is the configuration for a keel environment default, staging, production

type Input

type Input struct {
	Name     string   `yaml:"name"`
	Value    string   `yaml:"value,omitempty"`
	Required []string `yaml:"required,omitempty"`
}

Input is the configuration for a keel environment variable or secret

type ProjectConfig

type ProjectConfig struct {
	Environment EnvironmentConfig `yaml:"environment"`
	Secrets     []Input           `yaml:"secrets"`
	DisableAuth bool              `yaml:"disableKeelAuth"`
}

ProjectConfig is the configuration for a keel project

func Load

func Load(dir string) (*ProjectConfig, error)

func LoadFromBytes

func LoadFromBytes(data []byte) (*ProjectConfig, error)

func (*ProjectConfig) AllEnvironmentVariables

func (c *ProjectConfig) AllEnvironmentVariables() []string

AllEnvironmentVariables returns a slice of all of the unique environment variable key names defined across all environments

func (*ProjectConfig) AllSecrets

func (c *ProjectConfig) AllSecrets() []string

func (*ProjectConfig) GetEnvVars

func (p *ProjectConfig) GetEnvVars(env string) map[string]string

func (*ProjectConfig) ValidateSecrets

func (c *ProjectConfig) ValidateSecrets(localSecrets map[string]string) (bool, []string)

Jump to

Keyboard shortcuts

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