envconf

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 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 flag values parsed from command-line arguments and returns an error on parsing failure.

func NewWithKubeConfig added in v0.0.4

func NewWithKubeConfig(kubeconfig string) *Config

NewWithKubeConfig creates and initializes an empty environment configuration

func (*Config) AssessmentRegex

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

AssessmentRegex returns the environment assessment filter

func (*Config) Client

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

Client is a constructor function that returns a previously created klient.Client or create a new one based on configuration previously set. Willpanic on any error so it recommended that you are confident in the configuration or call NewClient() to ensure its safe creation.

func (*Config) FeatureRegex

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

FeatureRegex returns the environment's feature regex filter

func (*Config) KubeconfigFile added in v0.0.4

func (c *Config) KubeconfigFile() string

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) NewClient added in v0.0.4

func (c *Config) NewClient() (klient.Client, error)

NewClient is a constructor function that returns a previously created klient.Client or create a new one based on configuration previously set. Will return an error if unable to do so.

func (*Config) SkipAssessmentRegex added in v0.0.4

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

SkipAssessmentRegex returns the environment assessment filter

func (*Config) SkipFeatureRegex added in v0.0.4

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

SkipFeatureRegex returns the environment's skipfeature regex filter

func (*Config) SkipLabels added in v0.0.4

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

SkipLabels returns the environment's label filters

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) WithKubeconfigFile added in v0.0.3

func (c *Config) WithKubeconfigFile(kubecfg string) *Config

WithKubeconfigFile creates a new klient.Client and injects it in the cfg

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

func (*Config) WithSkipAssessmentRegex added in v0.0.4

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

WithSkipAssessmentRegex sets the environment assessment regex filter

func (*Config) WithSkipFeatureRegex added in v0.0.4

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

WithSkipFeatureRegex sets the environment's skip feature regex filter

func (*Config) WithSkipLabels added in v0.0.4

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

WithSkipLabels sets the environment label filters

Jump to

Keyboard shortcuts

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