Documentation
¶
Index ¶
- Variables
- func CollectContexts(names []map[string]string, fileCollections map[string]map[string]any, ...) []map[string]any
- func GetFakeFuncFactoryWithString() map[string]FakeFuncFactoryWithString
- func GetFakes() map[string]FakeFunc
- type BoolValue
- type FakeFunc
- type FakeFuncFactoryWithString
- type Float64Value
- type IntValue
- type MixedValue
- type ParsedContextResult
- type StringValue
Constants ¶
This section is empty.
Variables ¶
var Fakes = GetFakes()
Fakes is a map of registered fake functions.
Functions ¶
func CollectContexts ¶
func CollectContexts(names []map[string]string, fileCollections map[string]map[string]any, initial map[string]any) []map[string]any
CollectContexts collects contexts from the given list of context names, file collections and initial context.
func GetFakeFuncFactoryWithString ¶
func GetFakeFuncFactoryWithString() map[string]FakeFuncFactoryWithString
GetFakeFuncFactoryWithString returns a map of utility fake functions.
func GetFakes ¶
GetFakes returns a map of fake functions from underlying fake library by gathering all exported methods from the faker.Faker struct into map. The keys are the snake_cased dot-separated method names, which reflect the location of the function: For example: person.first_name will return a fake first name from the Person struct.
Types ¶
type FakeFunc ¶
type FakeFunc func() MixedValue
FakeFunc is a function that returns a MixedValue. This is u unified way to work with different return types from fake library.
type FakeFuncFactoryWithString ¶
FakeFuncFactoryWithString is a function that returns a FakeFunc.
type Float64Value ¶
type Float64Value float64
func (Float64Value) Get ¶
func (f Float64Value) Get() any
type MixedValue ¶
type MixedValue interface {
Get() any
}
MixedValue is a value that can represent string, int, float64, or bool type.
type ParsedContextResult ¶
ParsedContextResult is the result of parsing a context file.
func ParseContextFile ¶
func ParseContextFile(filePath string, fakes map[string]FakeFunc) (*ParsedContextResult, error)
ParseContextFile parses a YAML file and returns a map of context properties. Filename without extension is used as the context namespace and can be referenced: - in service config - when creating aliases
func ParseContextFromBytes ¶
func ParseContextFromBytes(content []byte, fakes map[string]FakeFunc) (*ParsedContextResult, error)
ParseContextFromBytes byte contents from the YAML file and returns a map of context properties.