envmanager

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MPL-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SECRET_KEY        = "secret"
	LOCALS_KEY        = "var"
	ENV_PREFIX        = "JAWS_"
	FILE_FUNC_SUCCESS = "DataWrittenToFileSuccessfully"
)
View Source
const (
	LABEL_PADDING       = 10
	NO_COMMENT          = ""
	JSON_COMMENT        = NO_COMMENT
	YAML_COMMENT        = "#"
	ENV_COMMENT         = "#"
	TF_COMMENT          = "#"
	INTERPRETER_SHEBANG = "#!jaws"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DecodeEnvFailed

type DecodeEnvFailed struct {
	File string
}

func (*DecodeEnvFailed) Error

func (e *DecodeEnvFailed) Error() string

type EnvConfig

type EnvConfig struct {
	Env       []*EnvHCL
	SecretIDs []string
	Options   Options
}

func InitEnv

func InitEnv(opts *Options) EnvConfig

InitEnv - initalizes EnvConfig

func (*EnvConfig) AddEnvConfig

func (e *EnvConfig) AddEnvConfig(file string) error

AddEnvConfig

func (*EnvConfig) Prepare

func (e *EnvConfig) Prepare() error

Prepare env config and return a string slice with all required secrets and an error

func (*EnvConfig) RecursiveSearchDir

func (e *EnvConfig) RecursiveSearchDir(dir string) error

RecursiveSearchDir

func (*EnvConfig) SearchDir

func (e *EnvConfig) SearchDir(dir string) error

SearchDir

func (*EnvConfig) Write

func (e *EnvConfig) Write() error

type EnvHCL

type EnvHCL struct {
	Prepared   bool
	Processed  bool
	Reader     io.Reader
	ConfigFile string
	Message    string   `hcl:"msg,optional"`
	OutFile    string   `hcl:"out,optional"`
	OutFormat  string   `hcl:"format,optional"`
	Profile    string   `hcl:"profile,optional"`
	Filter     string   `hcl:"filter,optional"`
	Includes   []string `hcl:"include,optional"`

	Locals []*struct {
		TmplVars hcl.Attributes `hcl:",remain"`
	} `hcl:"locals,block"`

	GroupedVars []*struct {
		TmplVars hcl.Attributes `hcl:",remain"`
	} `hcl:"vars,block"`

	GroupedLabeledVars []*struct {
		Label    string         `hcl:",label"`
		TmplVars hcl.Attributes `hcl:",remain"`
	} `hcl:"group,block"`
}

func (*EnvHCL) Process

func (e *EnvHCL) Process(secrets []secretsmanager.Secret) error

ProcessConfigs - create an environment file

type EnvIsDir

type EnvIsDir struct {
	Path string
}

func (*EnvIsDir) Error

func (e *EnvIsDir) Error() string

type NoEnvFileFound

type NoEnvFileFound struct {
	File string
}

func (*NoEnvFileFound) Error

func (e *NoEnvFileFound) Error() string

type Options

type Options struct {
	Diff           bool
	Overwrite      bool
	UnsafeMode     bool
	FilterOverride string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳