envconf

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: Apache-2.0 Imports: 8 Imported by: 87

Documentation

Overview

Package envconf stores configuration for a test environment

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandomName

func RandomName(prefix string, n int) string

RandomName generates a random name of n length with the provided prefix. If prefix is omitted, the then entire name is random char.

Types

type Config

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

Config represents and environment configuration

func New

func New() *Config

New creates and initializes an empty environment configuration

func NewFromFlags

func NewFromFlags() (*Config, error)

NewFromFlags initializes an environment config using values from command-line argument flags. See package flags for supported flags.

func NewWithKubeconfig

func NewWithKubeconfig(kubecfg string) (*Config, error)

NewWithKubeconfig is a convenience constructor function that creates a new environment configuration using a kubeconfig file.

func (*Config) AssessmentRegex

func (c *Config) AssessmentRegex() *regexp.Regexp

AssessmentRegex returns the environment assessment filter

func (*Config) AutoCreateNamespace

func (c *Config) AutoCreateNamespace() *Config

AutoCreateNamespace signals that a namespace should be automatically created for the environment

func (*Config) Client

func (c *Config) Client() klient.Client

Client returns the environment klient.Client

func (*Config) FeatureRegex

func (c *Config) FeatureRegex() *regexp.Regexp

FeatureRegex returns the environment's feature regex filter

func (*Config) Labels

func (c *Config) Labels() map[string]string

Labels returns the environment's label filters

func (*Config) Namespace

func (c *Config) Namespace() string

Namespace returns the namespace for the environment

func (*Config) NamespaceShouldBeCreated

func (c *Config) NamespaceShouldBeCreated() bool

NamespaceShouldBeCreated indicates if a namespace should be created for the environment

func (*Config) WithAssessmentRegex

func (c *Config) WithAssessmentRegex(regex string) *Config

WithAssessmentRegex sets the environment assessment regex filter

func (*Config) WithClient

func (c *Config) WithClient(client klient.Client) *Config

WithClient used to update the environment klient.Client

func (*Config) WithFeatureRegex

func (c *Config) WithFeatureRegex(regex string) *Config

WithFeatureRegex sets the environment's feature regex filter

func (*Config) WithLabels

func (c *Config) WithLabels(lbls map[string]string) *Config

WithLabels sets the environment label filters

func (*Config) WithNamespace

func (c *Config) WithNamespace(ns string) *Config

WithNamespace updates the environment namespace value

func (*Config) WithRandomNamespace

func (c *Config) WithRandomNamespace() *Config

WithRandomNamespace sets the environment's namespace to a random value

Jump to

Keyboard shortcuts

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