Documentation
¶
Index ¶
- Constants
- Variables
- func AssignToT[T any, U any](t *T, u U) error
- func BoolPtr(b bool) *bool
- func CheckFs(afs afero.Fs, expected []TestFsEntry) (err error)
- func CreateJsonPathChecker(expression string) (checker func(document any) (bool, error), err error)
- func CreateJsonPathCheckerFromEvaluable(jp gval.Evaluable) (checker func(document any) (bool, error))
- func CreateTemplateChecker(expression string) (checker func(document any) (bool, error), err error)
- func CreateTemplateCheckerFromTemplate(tmpl *template.Template) (checker func(document any) (bool, error))
- func DecodeNewValue[T any](input any) (*T, error)
- func DecodeValue[T any, U any](input T, output *U) (err error)
- func ExecuteTemplateTrimmed(tmpl *template.Template, doc any) (s string, err error)
- func GetJsonPath(expression string, document any) (result any, err error)
- func IsComparableEqual[V comparable](a, b V) bool
- func IsComparablePointerEqual[V comparable](a, b *V) bool
- func IsPointerEqualFunc[V any](a, b *V, equals func(*V, *V) bool) bool
- func IsSameValueOrPointer(a, b any) bool
- func NewJsonPath(expression string) (jp gval.Evaluable, err error)
- func NewLazyLoader[T any](loader func() T) func() T
- func NewLazyLoaderWithArg[T any, U comparable](loader func(U) T) func(U) T
- func NewLazyOnce(loader func()) func()
- func NewTemplate(expression string) (tmpl *template.Template, err error)
- func NewTemplateFilename(expression string, fileName string) (tmpl *template.Template, err error)
- func PrepareFs(afs afero.Fs, provided []TestFsEntry) (err error)
- func ReflectValueDeepEqualCompare(vA, vB reflect.Value) (err error)
- func ReflectValueStructFieldsCompare(vA, vB reflect.Value, cmp StructFieldsComparator) (err error)
- func ReflectValueUnorderedSliceCompare(vA, vB reflect.Value, compare ReflectValueCompareFn) (err error)
- func ReflectValueUnorderedSliceCompareDeepEqual(vA, vB reflect.Value) (err error)
- func SimplifyAny(value any) (converted any, err error)
- func StructFieldsCompare[T any](a, b T, cmp StructFieldsComparator) (err error)
- func StructFieldsEqual[T any](a, b T, cmp StructFieldsComparator) bool
- func UnorderedSliceCompareDeepEqual[T any, S ~[]T](a, b S) (err error)
- func UnorderedSliceDeepEqual[T any, S ~[]T](a, b S) bool
- type COW
- type COWContainer
- type COWContainerOfCOW
- type COWMap
- func (c *COWMap[K, V]) Delete(key K) (mutated bool)
- func (c *COWMap[K, V]) Equals(other map[K]V) bool
- func (c *COWMap[K, V]) ExistsAt(key K, value V) bool
- func (c *COWMap[K, V]) ForEach(cb func(key K, value V) (run bool)) (finished bool)
- func (c *COWMap[K, V]) Get(key K) (value V, ok bool)
- func (c *COWMap[K, V]) IsChanged() (changed bool)
- func (c *COWMap[K, V]) Len() int
- func (c *COWMap[K, V]) Peek() (m map[K]V)
- func (c *COWMap[K, V]) Release() (m map[K]V, changed bool)
- func (c *COWMap[K, V]) Replace(other map[K]V) bool
- func (c *COWMap[K, V]) Set(key K, value V) (mutated bool)
- type COWMapOfCOW
- func (c *COWMapOfCOW[K, V, C]) Delete(key K) (mutated bool)
- func (c *COWMapOfCOW[K, V, C]) Equals(other map[K]V) bool
- func (c *COWMapOfCOW[K, V, C]) ExistsAt(key K, value V) bool
- func (c *COWMapOfCOW[K, V, C]) ForEach(cb func(key K, item V) (run bool)) (finished bool)
- func (c *COWMapOfCOW[K, V, C]) ForEachCOW(cb func(key K, cow C) (run bool)) (finished bool)
- func (c *COWMapOfCOW[K, V, C]) Get(key K) (v V, ok bool)
- func (c *COWMapOfCOW[K, V, C]) GetCOW(key K) (cow C, ok bool)
- func (c *COWMapOfCOW[K, V, C]) IsChanged() (changed bool)
- func (c *COWMapOfCOW[K, V, C]) Len() int
- func (c *COWMapOfCOW[K, V, C]) Peek() (m map[K]V)
- func (c *COWMapOfCOW[K, V, C]) Release() (m map[K]V, changed bool)
- func (c *COWMapOfCOW[K, V, C]) Replace(other map[K]V) bool
- func (c *COWMapOfCOW[K, V, C]) Set(key K, value V) (mutated bool)
- type COWSlice
- func (c *COWSlice[V]) Add(value V)
- func (c *COWSlice[V]) Append(value V)
- func (c *COWSlice[V]) Contains(value V) bool
- func (c *COWSlice[V]) Delete(i int) (mutated bool)
- func (c *COWSlice[V]) Equals(other []V) bool
- func (c *COWSlice[V]) ExistsAt(i int, value V) bool
- func (c *COWSlice[V]) ForEach(cb func(index int, value V) (run bool)) (finished bool)
- func (c *COWSlice[V]) Get(i int) (value V, ok bool)
- func (c *COWSlice[V]) IsChanged() (changed bool)
- func (c *COWSlice[V]) Len() int
- func (c *COWSlice[V]) Peek() (s []V)
- func (c *COWSlice[V]) Release() (s []V, changed bool)
- func (c *COWSlice[V]) Replace(other []V) bool
- func (c *COWSlice[V]) Resize(newSize int)
- func (c *COWSlice[V]) Set(i int, value V) (mutated bool)
- type COWSliceOfCOW
- func (c *COWSliceOfCOW[V, C]) Add(value V)
- func (c *COWSliceOfCOW[V, C]) Append(value V)
- func (c *COWSliceOfCOW[V, C]) Contains(value V) bool
- func (c *COWSliceOfCOW[V, C]) Delete(i int) (mutated bool)
- func (c *COWSliceOfCOW[V, C]) Equals(other []V) bool
- func (c *COWSliceOfCOW[V, C]) ExistsAt(i int, value V) bool
- func (c *COWSliceOfCOW[V, C]) ForEach(cb func(index int, item V) (run bool)) (finished bool)
- func (c *COWSliceOfCOW[V, C]) ForEachCOW(cb func(index int, cow C) (run bool)) (finished bool)
- func (c *COWSliceOfCOW[V, C]) Get(i int) (v V, ok bool)
- func (c *COWSliceOfCOW[V, C]) GetCOW(i int) (cow C, ok bool)
- func (c *COWSliceOfCOW[V, C]) IsChanged() (changed bool)
- func (c *COWSliceOfCOW[V, C]) Len() int
- func (c *COWSliceOfCOW[V, C]) Peek() (s []V)
- func (c *COWSliceOfCOW[V, C]) Release() (s []V, changed bool)
- func (c *COWSliceOfCOW[V, C]) Replace(other []V) bool
- func (c *COWSliceOfCOW[V, C]) Resize(newSize int)
- func (c *COWSliceOfCOW[V, C]) Set(i int, value V) (mutated bool)
- type ChainedError
- type CompareError
- type LoadWithError
- type MapEntry
- type MultiError
- type OnceWithError
- type ReflectValueCompareFn
- type StructFieldsComparator
- type TestFsEntry
Constants ¶
const ( CompareTypeErrorKey = "$type" CompareLengthErrorKey = "$length" CompareAErrorKey = "$A" CompareBErrorKey = "$B" )
const DIR_PERMISSION = 0744
const FILE_PERMISSION = 0644
These two const are needed because only 07xx (executable) directories can be accessed
Variables ¶
var ErrorNotLoaded = errors.New("not loaded")
Functions ¶
func CreateJsonPathChecker ¶
func CreateTemplateChecker ¶
func DecodeNewValue ¶
Attempts to decode the value passed in as input to the structure specified by the template Structs can be converted to maps and vice-versa, strings to integers, etc... The Tag used for specifying how to decode/encode is centralized in 'json', no need to use 'mapstructure'.
func DecodeValue ¶
Attempts to decode the value passed in as input to the structure specified by the template Structs can be converted to maps and vice-versa, strings to integers, etc... The Tag used for specifying how to decode/encode is centralized in 'json', no need to use 'mapstructure'.
func ExecuteTemplateTrimmed ¶
func IsComparableEqual ¶
func IsComparableEqual[V comparable](a, b V) bool
func IsComparablePointerEqual ¶
func IsComparablePointerEqual[V comparable](a, b *V) bool
func IsPointerEqualFunc ¶
equals is only called if both pointers are non-nil
func IsSameValueOrPointer ¶
Checks if the value is exactly the same, it's basically a "==" but handles map/slice and other non-comparable types as pointers, that is if their underlying pointer is the same. It DOES NOT check for map/slice similarities, only their addresses.
func NewLazyLoader ¶
func NewLazyLoader[T any](loader func() T) func() T
func NewLazyLoaderWithArg ¶
func NewLazyLoaderWithArg[T any, U comparable](loader func(U) T) func(U) T
Type U *MUST* be comparable
func NewLazyOnce ¶
func NewLazyOnce(loader func()) func()
func NewTemplateFilename ¶
func ReflectValueStructFieldsCompare ¶
func ReflectValueStructFieldsCompare(vA, vB reflect.Value, cmp StructFieldsComparator) (err error)
func ReflectValueUnorderedSliceCompare ¶
func ReflectValueUnorderedSliceCompare(vA, vB reflect.Value, compare ReflectValueCompareFn) (err error)
Compares the slices ignoring their order (quadratic: O(len(a) * O(len(b)))
func SimplifyAny ¶
This function takes any Go value (simple types, arrays, maps, structs, pointers...) and converts it into the simplest possible native types. Pointers are converted into their respective underlying value, structs are converted into map[string]any, etc. This operation is recursive and will convert the passed value in its entirety, and not just the first depth level
func StructFieldsCompare ¶
func StructFieldsCompare[T any](a, b T, cmp StructFieldsComparator) (err error)
func StructFieldsEqual ¶
func StructFieldsEqual[T any](a, b T, cmp StructFieldsComparator) bool
func UnorderedSliceDeepEqual ¶
Types ¶
type COW ¶
type COW[T any] interface { // Compare current value to another. // // May be called on nil COW handle, compares to the empty value of T. Equals(other T) bool // Return the current value and if it was changed, resets the internal pointers // // May be called on nil COW handle, returns the empty value of T. Release() (value T, changed bool) // Return the current value, do not modify it! // // May be called on nil COW handle, returns the empty value of T Peek() (value T) // Checks if the COW was mutated from its original value. // // May be called on nil COW handle, returns false. IsChanged() (changed bool) // Replace the internal value with another, if it's different. // // **CANNOT** be called on nil COW handle. Replace(other T) bool }
type COWContainer ¶
type COWContainer[K comparable, V any] interface { // Iterates over all items of the container. // // If cb returns false the loop will stop and this function will also return false. // Otherwise this function returns true (meaning it looped through all items) // // May be called on nil COW handle, won't iterate and return true. ForEach(cb func(key K, value V) (run bool)) (finished bool) // Get the item at key. // // May be called on nil COW handle, returns the empty value of V and ok == false. Get(key K) (value V, ok bool) // Get the current container length. // // May be called on nil COW handle, returns 0. Len() int // Checks if the given value exists at the target key // // May be called on nil COW handle, returns false. ExistsAt(key K, value V) bool // Set is smart to not modify the map if value is the same // // Returns true if the value was modified, false otherwise. // // **CANNOT** be called on nil COW handle. Set(key K, value V) bool // Deletes the key (if it exists). // // May be called on nil COW handle, nothing is done Delete(key K) bool }
COW that is a container of other values (ie: slice, map)
type COWContainerOfCOW ¶
type COWContainerOfCOW[K comparable, V any, C COW[V]] interface { // Iterates over all COW items of the container. // // If cb returns false the loop will stop and this function will also return false. // Otherwise this function returns true (meaning it looped through all items) // // May be called on nil COW handle, won't iterate and return true. ForEachCOW(cb func(key K, cow C) (run bool)) (finished bool) // Get the COW item at key. // // May be called on nil COW handle, returns the empty COW of C and ok == false. GetCOW(key K) (cow C, ok bool) }
COW that is a container of other values (ie: slice, map) that are exposed as children COW.
type COWMap ¶
type COWMap[K comparable, V any] struct { // contains filtered or unexported fields }
Map that will be copied before its first write, the original value is used if no writes were done
func NewCOWMapComparable ¶
func NewCOWMapComparable[K comparable, V comparable](m map[K]V) *COWMap[K, V]
func NewCOWMapFunc ¶
func NewCOWMapFunc[K comparable, V any](m map[K]V, equals func(V, V) bool) *COWMap[K, V]
func (*COWMap[K, V]) Delete ¶
Deletes the key (if it exists).
May be called on nil COW handle, nothing is done
func (*COWMap[K, V]) ExistsAt ¶
Checks if the given value exists at the target key
May be called on nil COW handle, returns false.
func (*COWMap[K, V]) ForEach ¶
Iterates over all map items.
If cb returns false the loop will stop and this function will also return false. Otherwise this function returns true (meaning it looped through all items)
May be called on nil COW handle, won't iterate and return true.
func (*COWMap[K, V]) Get ¶
Get the item at key.
May be called on nil COW handle, returns the empty value of V and ok == false.
func (*COWMap[K, V]) Peek ¶
func (c *COWMap[K, V]) Peek() (m map[K]V)
Get the pointer to the internal reference.
DO NOT MODIFY THE RETURNED MAP
type COWMapOfCOW ¶
type COWMapOfCOW[K comparable, V any, C COW[V]] struct { // contains filtered or unexported fields }
Map that will be copied before its first write, the original value is used if no writes were done
This variant will create a COW for each element, making it easy for users. Writes to the element's COW will update the parent (container) map (m) given at construction.
func NewCOWMapOfCOW ¶
func NewCOWMapOfCOW[K comparable, V any, C COW[V]](m map[K]V, cowFactory func(V) C) *COWMapOfCOW[K, V, C]
func (*COWMapOfCOW[K, V, C]) Delete ¶
func (c *COWMapOfCOW[K, V, C]) Delete(key K) (mutated bool)
Deletes the key (if it exists).
May be called on nil COW handle, nothing is done
func (*COWMapOfCOW[K, V, C]) Equals ¶
func (c *COWMapOfCOW[K, V, C]) Equals(other map[K]V) bool
func (*COWMapOfCOW[K, V, C]) ExistsAt ¶
func (c *COWMapOfCOW[K, V, C]) ExistsAt(key K, value V) bool
Checks if the given value exists at the target key
May be called on nil COW handle, returns false.
func (*COWMapOfCOW[K, V, C]) ForEach ¶
func (c *COWMapOfCOW[K, V, C]) ForEach(cb func(key K, item V) (run bool)) (finished bool)
Iterates over all map items.
If cb returns false the loop will stop and this function will also return false. Otherwise this function returns true (meaning it looped through all items)
May be called on nil COW handle, won't iterate and return true.
func (*COWMapOfCOW[K, V, C]) ForEachCOW ¶
func (c *COWMapOfCOW[K, V, C]) ForEachCOW(cb func(key K, cow C) (run bool)) (finished bool)
Iterates over all map COW items.
If cb returns false the loop will stop and this function will also return false. Otherwise this function returns true (meaning it looped through all items)
May be called on nil COW handle, won't iterate and return true.
func (*COWMapOfCOW[K, V, C]) Get ¶
func (c *COWMapOfCOW[K, V, C]) Get(key K) (v V, ok bool)
Gets the plain value at the given key. Do not mutate it, if you want to mutate use GetCOW()
func (*COWMapOfCOW[K, V, C]) GetCOW ¶
func (c *COWMapOfCOW[K, V, C]) GetCOW(key K) (cow C, ok bool)
Gets the Copy-on-Write value at the given key.
If the COW is mutated, the COWMapOfCOW (c) will reflect the new value automatically.
For the plain value, use Get().
func (*COWMapOfCOW[K, V, C]) IsChanged ¶
func (c *COWMapOfCOW[K, V, C]) IsChanged() (changed bool)
func (*COWMapOfCOW[K, V, C]) Len ¶
func (c *COWMapOfCOW[K, V, C]) Len() int
Get the current map length.
May be called on nil COW handle, returns 0.
func (*COWMapOfCOW[K, V, C]) Peek ¶
func (c *COWMapOfCOW[K, V, C]) Peek() (m map[K]V)
Get the pointer to the internal reference.
DO NOT MODIFY THE RETURNED MAP
func (*COWMapOfCOW[K, V, C]) Release ¶
func (c *COWMapOfCOW[K, V, C]) Release() (m map[K]V, changed bool)
func (*COWMapOfCOW[K, V, C]) Replace ¶
func (c *COWMapOfCOW[K, V, C]) Replace(other map[K]V) bool
Only does it if the maps are not equal.
The COWMap will be set as changed and other will be COPIED.
**CANNOT** be called on nil COW handle.
func (*COWMapOfCOW[K, V, C]) Set ¶
func (c *COWMapOfCOW[K, V, C]) Set(key K, value V) (mutated bool)
Set is smart to not modify the map if value is the same
Returns true if the value was modified, false otherwise.
**CANNOT** be called on nil COW handle.
type COWSlice ¶
type COWSlice[V any] struct { // contains filtered or unexported fields }
Slice that will be copied before its first write, the original value is used if no writes were done
func NewCOWSliceComparable ¶
func NewCOWSliceComparable[V comparable](s []V) *COWSlice[V]
func NewCOWSliceFunc ¶
func (*COWSlice[V]) Add ¶
func (c *COWSlice[V]) Add(value V)
If not Contains(value), then Append(value)
**CANNOT** be called on nil COW handle.
func (*COWSlice[V]) Append ¶
func (c *COWSlice[V]) Append(value V)
Unconditionally appends the value.
**CANNOT** be called on nil COW handle.
func (*COWSlice[V]) Contains ¶
Checks if the given value exists in the slice
May be called on nil COW handle, returns false.
func (*COWSlice[V]) Delete ¶
Deletes the index (if it exists).
May be called on nil COW handle, nothing is done
func (*COWSlice[V]) ExistsAt ¶
Checks if the given value exists at the target position
May be called on nil COW handle, returns false.
func (*COWSlice[V]) ForEach ¶
Iterates over all slice items.
If cb returns false the loop will stop and this function will also return false. Otherwise this function returns true (meaning it looped through all items)
May be called on nil COW handle, won't iterate and returns true.
func (*COWSlice[V]) Get ¶
Get the item at index.
May be called on nil COW handle, returns the empty value of V and ok == false.
func (*COWSlice[V]) Peek ¶
func (c *COWSlice[V]) Peek() (s []V)
Get the pointer to the internal reference.
DO NOT MODIFY THE RETURNED SLICE
func (*COWSlice[V]) Replace ¶
Only does it if the slices are not equal.
The COWSlice will be set as changed and other will be COPIED.
**CANNOT** be called on nil COW handle.
type COWSliceOfCOW ¶
Slice that will be copied before its first write, the original value is used if no writes were done
This variant will create a COW for each element, making it easy for users. Writes to the element's COW will update the parent (container) slice (s) given at construction.
func NewCOWSliceOfCOW ¶
func NewCOWSliceOfCOW[V any, C COW[V]](s []V, cowFactory func(V) C) *COWSliceOfCOW[V, C]
func (*COWSliceOfCOW[V, C]) Add ¶
func (c *COWSliceOfCOW[V, C]) Add(value V)
If not Contains(value), then Append(value)
**CANNOT** be called on nil COW handle.
func (*COWSliceOfCOW[V, C]) Append ¶
func (c *COWSliceOfCOW[V, C]) Append(value V)
Unconditionally appends the value.
**CANNOT** be called on nil COW handle.
func (*COWSliceOfCOW[V, C]) Contains ¶
func (c *COWSliceOfCOW[V, C]) Contains(value V) bool
Checks if the given value exists in the slice
May be called on nil COW handle, returns false.
func (*COWSliceOfCOW[V, C]) Delete ¶
func (c *COWSliceOfCOW[V, C]) Delete(i int) (mutated bool)
Deletes the index (if it exists).
May be called on nil COW handle, nothing is done
func (*COWSliceOfCOW[V, C]) Equals ¶
func (c *COWSliceOfCOW[V, C]) Equals(other []V) bool
func (*COWSliceOfCOW[V, C]) ExistsAt ¶
func (c *COWSliceOfCOW[V, C]) ExistsAt(i int, value V) bool
Checks if the given value exists at the target position
May be called on nil COW handle, returns false.
func (*COWSliceOfCOW[V, C]) ForEach ¶
func (c *COWSliceOfCOW[V, C]) ForEach(cb func(index int, item V) (run bool)) (finished bool)
Iterates over all slice items.
If cb returns false the loop will stop and this function will also return false. Otherwise this function returns true (meaning it looped through all items)
May be called on nil COW handle, won't iterate and returns true.
func (*COWSliceOfCOW[V, C]) ForEachCOW ¶
func (c *COWSliceOfCOW[V, C]) ForEachCOW(cb func(index int, cow C) (run bool)) (finished bool)
Iterates over all slice COW items.
If cb returns false the loop will stop and this function will also return false. Otherwise this function returns true (meaning it looped through all items)
May be called on nil COW handle, won't iterate and returns true.
func (*COWSliceOfCOW[V, C]) Get ¶
func (c *COWSliceOfCOW[V, C]) Get(i int) (v V, ok bool)
Get the item at index.
May be called on nil COW handle, returns the empty value of V and ok == false.
func (*COWSliceOfCOW[V, C]) GetCOW ¶
func (c *COWSliceOfCOW[V, C]) GetCOW(i int) (cow C, ok bool)
Gets the Copy-on-Write value at the given index.
If the COW is mutated, the COWSliceOfCOW (c) will reflect the new value automatically.
For the plain value, use Get().
May be called on nil COW handle, returns the empty value of C and ok == false.
func (*COWSliceOfCOW[V, C]) IsChanged ¶
func (c *COWSliceOfCOW[V, C]) IsChanged() (changed bool)
func (*COWSliceOfCOW[V, C]) Len ¶
func (c *COWSliceOfCOW[V, C]) Len() int
Get the current slice length.
May be called on nil COW handle, returns 0.
func (*COWSliceOfCOW[V, C]) Peek ¶
func (c *COWSliceOfCOW[V, C]) Peek() (s []V)
Get the pointer to the internal reference.
DO NOT MODIFY THE RETURNED SLICE
func (*COWSliceOfCOW[V, C]) Release ¶
func (c *COWSliceOfCOW[V, C]) Release() (s []V, changed bool)
func (*COWSliceOfCOW[V, C]) Replace ¶
func (c *COWSliceOfCOW[V, C]) Replace(other []V) bool
Only does it if the slices are not equal.
The COWSlice will be set as changed and other will be COPIED ¶
**CANNOT** be called on nil COW handle.
func (*COWSliceOfCOW[V, C]) Resize ¶
func (c *COWSliceOfCOW[V, C]) Resize(newSize int)
Resize the slice, if needed
**CANNOT** be called on nil COW handle
func (*COWSliceOfCOW[V, C]) Set ¶
func (c *COWSliceOfCOW[V, C]) Set(i int, value V) (mutated bool)
Set is smart to not modify the slice if value is the same
Will grow the slice if needed.
Returns true if the value was modified, false otherwise.
**CANNOT** be called on nil COW handle.
type ChainedError ¶
Chained error that builds a path in the error message
It walks Err chain looking for other ChainedError, building a JSON Pointer-compatible path ("/" and "~" are escaped with "~0/1") and outputs the final error message
It's particularly useful to validate specifications and nested trees.
func (*ChainedError) Error ¶
func (e *ChainedError) Error() string
func (*ChainedError) Is ¶
func (e *ChainedError) Is(target error) bool
func (*ChainedError) Unwrap ¶
func (e *ChainedError) Unwrap() error
type CompareError ¶
func (*CompareError) Error ¶
func (e *CompareError) Error() string
func (*CompareError) Is ¶
func (e *CompareError) Is(target error) bool
type LoadWithError ¶
func NewLazyLoaderWithError ¶
func NewLazyLoaderWithError[T any](loader LoadWithError[T]) LoadWithError[T]
type MapEntry ¶
type MapEntry[K comparable, V any] struct { Key K Value V }
func SortedMapIterator ¶
func SortedMapIterator[K constraints.Integer | string, V any](m map[K]V) []MapEntry[K, V]
type MultiError ¶
type MultiError []error
func (MultiError) Error ¶
func (e MultiError) Error() string
func (MultiError) Unwrap ¶
func (e MultiError) Unwrap() []error
type OnceWithError ¶
type OnceWithError func() error
func NewLazyOnceWithError ¶
func NewLazyOnceWithError(loader OnceWithError) OnceWithError
type ReflectValueCompareFn ¶
type StructFieldsComparator ¶
type StructFieldsComparator interface {
Type() reflect.Type
// field index at reflect.Type
Compare(field int, vA, vB reflect.Value) (err error)
}
func NewMapStructFieldsComparator ¶
func NewMapStructFieldsComparator[T any](fields map[string]ReflectValueCompareFn) StructFieldsComparator
type TestFsEntry ¶
func AutoMkdirAll ¶
func AutoMkdirAll(entries []TestFsEntry) (expanded []TestFsEntry)
func FindFsEntry ¶
func FindFsEntry(path string, entries []TestFsEntry) (TestFsEntry, error)
func MergeFsEntries ¶
func MergeFsEntries(toBeMerged ...[]TestFsEntry) (merged []TestFsEntry)