Documentation
¶
Index ¶
Constants ¶
View Source
const ( // CloudRunMode is the string that will be used to override the run mode of execution to cloud CloudRunMode RunMode = "cloud" // DefaultRunMode is the default execution run mode DefaultRunMode RunMode = "default" // DefaultLogMarkerHeaderName is the default log marker header name DefaultLogMarkerHeaderName string = "X-CRS-Test" )
Variables ¶
This section is empty.
Functions ¶
func NewConfigFromEnv ¶
func NewConfigFromEnv() error
NewConfigFromEnv reads configuration information from environment variables that start with `FTW_`
func NewConfigFromFile ¶
NewConfigFromFile reads configuration information from the config file if it exists, or uses `.ftw.yaml` as default file
func NewConfigFromString ¶
NewConfigFromString initializes the configuration from a yaml formatted string. Useful for testing.
Types ¶
type FTWConfiguration ¶
type FTWConfiguration struct {
LogFile string `koanf:"logfile"`
TestOverride FTWTestOverride `koanf:"testoverride"`
LogMarkerHeaderName string `koanf:"logmarkerheadername"`
RunMode RunMode `koanf:"mode"`
}
FTWConfiguration FTW global Configuration
var FTWConfig *FTWConfiguration
FTWConfig is being exported to be used across the app
type FTWRegexp ¶ added in v0.4.1
func (*FTWRegexp) MatchString ¶ added in v0.4.1
func (*FTWRegexp) UnmarshalText ¶ added in v0.4.1
type FTWTestOverride ¶
type FTWTestOverride struct {
Input test.Input `koanf:"input"`
Ignore map[*FTWRegexp]string `koanf:"ignore"`
ForcePass map[*FTWRegexp]string `koanf:"forcepass"`
ForceFail map[*FTWRegexp]string `koanf:"forcefail"`
}
FTWTestOverride holds four lists:
Input allows you to override input parameters in tests. An example usage is if you want to change the `dest_addr` of all tests to point to an external IP or host. Ignore is for tests you want to ignore. You should add a comment on why you ignore the test ForcePass is for tests you want to pass unconditionally. You should add a comment on why you force to pass the test ForceFail is for tests you want to fail unconditionally. You should add a comment on why you force to fail the test
Click to show internal directories.
Click to hide internal directories.