configuration

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GremlinsSilentKey            = "silent"
	UnleashDryRunKey             = "unleash.dry-run"
	UnleashOutputKey             = "unleash.output"
	UnleashTagsKey               = "unleash.tags"
	UnleashCoverPkgKey           = "unleash.coverpkg"
	UnleashWorkersKey            = "unleash.workers"
	UnleashTestCPUKey            = "unleash.test-cpu"
	UnleashTimeoutCoefficientKey = "unleash.timeout-coefficient"
	UnleashIntegrationMode       = "unleash.integration"
	UnleashDiffRef               = "unleash.diff"
	UnleashThresholdEfficacyKey  = "unleash.threshold.efficacy"
	UnleashThresholdMCoverageKey = "unleash.threshold.mutant-coverage"
)

This is the list of the keys available in config files and as flags.

Variables

This section is empty.

Functions

func Get

func Get[T any](k string) T

Get offers synchronised access to Viper.

func Init

func Init(cPaths []string) error

Init initializes the viper configuration for Gremlins.

It sets the configuration file name as .gremlins.yaml, adds the passed paths as ConfigPaths AutomaticEnv configuration having GREMLINS as prefix. The environment variables take precedence over the configuration file and must be set in the format:

GREMLINS_<COMMAND NAME>_<FLAG NAME>

func IsDefaultEnabled

func IsDefaultEnabled(mt mutator.Type) bool

IsDefaultEnabled returns the default enabled/disabled state of the mutation. It gets the state from the table above that must be kept up to date when adding new mutant types.

func MutantTypeEnabledKey

func MutantTypeEnabledKey(mt mutator.Type) string

MutantTypeEnabledKey returns the configuration key for a mutant. The generated key will have the format 'mutants.mutant-name.enabled", which corresponds to the Yaml:

	mutants:
 		mutant-name:
 			enabled: [bool]

func Reset

func Reset()

Reset is used mainly for testing purposes, in order to clean up the Viper instance.

func Set

func Set[T any](k string, v T)

Set offers synchronised access to Viper.

Types

This section is empty.

Jump to

Keyboard shortcuts

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