env

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AwsEnvPrinter

type AwsEnvPrinter struct {
	BaseEnvPrinter
}

AwsEnvPrinter is a struct that simulates an AWS environment for testing purposes.

func NewAwsEnvPrinter

func NewAwsEnvPrinter(injector di.Injector) *AwsEnvPrinter

NewAwsEnvPrinter initializes a new awsEnv instance using the provided dependency injector.

func (*AwsEnvPrinter) GetEnvVars

func (e *AwsEnvPrinter) GetEnvVars() (map[string]string, error)

GetEnvVars retrieves the environment variables for the AWS environment.

func (*AwsEnvPrinter) Print

func (e *AwsEnvPrinter) Print() error

Print prints the environment variables for the AWS environment.

type BaseEnvPrinter

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

Env is a struct that implements the EnvPrinter interface.

func NewBaseEnvPrinter

func NewBaseEnvPrinter(injector di.Injector) *BaseEnvPrinter

NewBaseEnvPrinter creates a new BaseEnvPrinter instance.

func (*BaseEnvPrinter) GetEnvVars

func (e *BaseEnvPrinter) GetEnvVars() (map[string]string, error)

GetEnvVars is a placeholder for retrieving environment variables.

func (*BaseEnvPrinter) Initialize

func (e *BaseEnvPrinter) Initialize() error

Initialize initializes the environment.

func (*BaseEnvPrinter) PostEnvHook

func (e *BaseEnvPrinter) PostEnvHook() error

PostEnvHook simulates running any necessary commands after the environment variables have been set.

func (*BaseEnvPrinter) Print

func (e *BaseEnvPrinter) Print(customVars ...map[string]string) error

Print prints the environment variables to the console. It can optionally take a map of key:value strings and prints those.

type DockerEnvPrinter

type DockerEnvPrinter struct {
	BaseEnvPrinter
}

DockerEnvPrinter is a struct that simulates a Docker environment for testing purposes.

func NewDockerEnvPrinter

func NewDockerEnvPrinter(injector di.Injector) *DockerEnvPrinter

NewDockerEnvPrinter initializes a new dockerEnv instance using the provided dependency injector.

func (*DockerEnvPrinter) GetEnvVars

func (e *DockerEnvPrinter) GetEnvVars() (map[string]string, error)

GetEnvVars retrieves the environment variables for the Docker environment.

func (*DockerEnvPrinter) Print

func (e *DockerEnvPrinter) Print() error

Print prints the environment variables for the Docker environment.

type EnvPrinter

type EnvPrinter interface {
	Initialize() error
	Print() error
	GetEnvVars() (map[string]string, error)
	PostEnvHook() error
}

EnvPrinter defines the method for printing environment variables.

type KubeEnvPrinter

type KubeEnvPrinter struct {
	BaseEnvPrinter
}

KubeEnvPrinter is a struct that simulates a Kubernetes environment for testing purposes.

func NewKubeEnvPrinter

func NewKubeEnvPrinter(injector di.Injector) *KubeEnvPrinter

NewKubeEnv initializes a new kubeEnv instance using the provided dependency injector.

func (*KubeEnvPrinter) GetEnvVars

func (e *KubeEnvPrinter) GetEnvVars() (map[string]string, error)

GetEnvVars retrieves the environment variables for the Kubernetes environment.

func (*KubeEnvPrinter) Print

func (e *KubeEnvPrinter) Print() error

Print prints the environment variables for the Kube environment.

type MockEnvPrinter

type MockEnvPrinter struct {
	BaseEnvPrinter
	InitializeFunc  func() error
	PrintFunc       func() error
	PostEnvHookFunc func() error
	GetEnvVarsFunc  func() (map[string]string, error)
}

MockEnvPrinter is a struct that simulates an environment for testing purposes.

func NewMockEnvPrinter

func NewMockEnvPrinter() *MockEnvPrinter

NewMockEnvPrinter creates a new instance of MockEnvPrinter.

func (*MockEnvPrinter) GetEnvVars

func (m *MockEnvPrinter) GetEnvVars() (map[string]string, error)

GetEnvVars simulates retrieving environment variables. If a custom GetEnvVarsFunc is provided, it will use that function instead.

func (*MockEnvPrinter) Initialize

func (m *MockEnvPrinter) Initialize() error

Initialize calls the custom InitializeFunc if provided.

func (*MockEnvPrinter) PostEnvHook

func (m *MockEnvPrinter) PostEnvHook() error

PostEnvHook simulates running any necessary commands after the environment variables have been set. If a custom PostEnvHookFunc is provided, it will use that function instead.

func (*MockEnvPrinter) Print

func (m *MockEnvPrinter) Print() error

Print simulates printing the provided environment variables. If a custom PrintFunc is provided, it will use that function instead.

type OmniEnvPrinter

type OmniEnvPrinter struct {
	BaseEnvPrinter
}

OmniEnvPrinter is a struct that simulates a Kubernetes environment for testing purposes.

func NewOmniEnvPrinter

func NewOmniEnvPrinter(injector di.Injector) *OmniEnvPrinter

NewOmniEnv initializes a new omniEnv instance using the provided dependency injector.

func (*OmniEnvPrinter) GetEnvVars

func (e *OmniEnvPrinter) GetEnvVars() (map[string]string, error)

GetEnvVars retrieves the environment variables for the Omni environment.

func (*OmniEnvPrinter) Print

func (e *OmniEnvPrinter) Print() error

Print prints the environment variables for the Omni environment.

type SopsEnvPrinter

type SopsEnvPrinter struct {
	BaseEnvPrinter
}

SopsEnvPrinter is a struct that simulates a Kubernetes environment for testing purposes.

func NewSopsEnvPrinter

func NewSopsEnvPrinter(injector di.Injector) *SopsEnvPrinter

NewSopsEnvPrinter initializes a new SopsEnvPrinter instance using the provided dependency injector.

func (*SopsEnvPrinter) GetEnvVars

func (e *SopsEnvPrinter) GetEnvVars() (map[string]string, error)

GetEnvVars retrieves the environment variables for the SOPS environment.

func (*SopsEnvPrinter) Print

func (e *SopsEnvPrinter) Print() error

Print prints the environment variables for the SOPS environment.

type TalosEnvPrinter

type TalosEnvPrinter struct {
	BaseEnvPrinter
}

TalosEnvPrinter is a struct that simulates a Kubernetes environment for testing purposes.

func NewTalosEnvPrinter

func NewTalosEnvPrinter(injector di.Injector) *TalosEnvPrinter

NewTalosEnvPrinter initializes a new talosEnvPrinter instance using the provided dependency injector.

func (*TalosEnvPrinter) GetEnvVars

func (e *TalosEnvPrinter) GetEnvVars() (map[string]string, error)

GetEnvVars retrieves the environment variables for the Talos environment.

func (*TalosEnvPrinter) Print

func (e *TalosEnvPrinter) Print() error

Print prints the environment variables for the Talos environment.

type TerraformEnvPrinter

type TerraformEnvPrinter struct {
	BaseEnvPrinter
}

TerraformEnvPrinter is a struct that simulates a Terraform environment for testing purposes.

func NewTerraformEnvPrinter

func NewTerraformEnvPrinter(injector di.Injector) *TerraformEnvPrinter

NewTerraformEnvPrinter initializes a new TerraformEnvPrinter instance using the provided dependency injector.

func (*TerraformEnvPrinter) GetEnvVars

func (e *TerraformEnvPrinter) GetEnvVars() (map[string]string, error)

GetEnvVars retrieves the environment variables for the Terraform environment.

func (*TerraformEnvPrinter) PostEnvHook

func (e *TerraformEnvPrinter) PostEnvHook() error

PostEnvHook executes any required operations after setting the environment variables.

func (*TerraformEnvPrinter) Print

func (e *TerraformEnvPrinter) Print() error

Print prints the environment variables for the Terraform environment.

type WindsorEnvPrinter

type WindsorEnvPrinter struct {
	BaseEnvPrinter
}

WindsorEnvPrinter is a struct that simulates a Kubernetes environment for testing purposes.

func NewWindsorEnvPrinter

func NewWindsorEnvPrinter(injector di.Injector) *WindsorEnvPrinter

NewWindsorEnvPrinter initializes a new WindsorEnvPrinter instance using the provided dependency injector.

func (*WindsorEnvPrinter) GetEnvVars

func (e *WindsorEnvPrinter) GetEnvVars() (map[string]string, error)

GetEnvVars retrieves the environment variables for the Windsor environment.

func (*WindsorEnvPrinter) Print

func (e *WindsorEnvPrinter) Print() error

Print prints the environment variables for the Windsor environment.

Jump to

Keyboard shortcuts

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