tester

package
Version: v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnvTest

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

EnvTest Environment variables manager for tests.

func NewEnvTest

func NewEnvTest(keys ...string) *EnvTest

NewEnvTest Creates an EnvTest.

func (*EnvTest) Apply

func (e *EnvTest) Apply(envVars map[string]string)

Apply Sets/Unsets environment variables. Not related to the main environment variables.

func (*EnvTest) ClearEnv

func (e *EnvTest) ClearEnv()

ClearEnv Deletes all environment variables related to the test.

func (*EnvTest) GetDomain

func (e *EnvTest) GetDomain() string

GetDomain Gets the domain value associated with the DNS challenge (linked to WithDomain method).

func (*EnvTest) GetValue

func (e *EnvTest) GetValue(key string) string

GetValue Gets the stored value of an environment variable.

func (*EnvTest) IsLiveTest

func (e *EnvTest) IsLiveTest() bool

IsLiveTest Checks whether environment variables allow running a "live" test.

func (*EnvTest) RestoreEnv

func (e *EnvTest) RestoreEnv()

RestoreEnv Restores the environment variables to the initial state.

func (*EnvTest) WithDomain

func (e *EnvTest) WithDomain(key string) *EnvTest

WithDomain Defines the name of the environment variable used to define the domain related to the DNS request. If the domain is defined, it was considered mandatory to define a test as a "live" test.

func (*EnvTest) WithLiveTestExtra

func (e *EnvTest) WithLiveTestExtra(extra func() bool) *EnvTest

WithLiveTestExtra Allows to define an additional condition to flag a test as "live" test. This does not replace the default behavior.

func (*EnvTest) WithLiveTestRequirements

func (e *EnvTest) WithLiveTestRequirements(keys ...string) *EnvTest

WithLiveTestRequirements Defines the environment variables required to define a test as a "live" test. Replaces the default behavior (all keys are required).

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL