Documentation
¶
Overview ¶
Package be_reflected offers Be matchers for reflection in Go, enabling expressive and versatile assertions on values' reflect kinds.
Index ¶
- func AsBytes() types.BeMatcher
- func AsChan() types.BeMatcher
- func AsFinalPointer() types.BeMatcher
- func AsFloatish() types.BeMatcher
- func AsFloatishString() types.BeMatcher
- func AsFunc() types.BeMatcher
- func AsIntish() types.BeMatcher
- func AsIntishString() types.BeMatcher
- func AsKind(args ...any) types.BeMatcher
- func AsMap() types.BeMatcher
- func AsNumeric() types.BeMatcher
- func AsNumericString() types.BeMatcher
- func AsObject() types.BeMatcher
- func AsObjects() types.BeMatcher
- func AsPointer() types.BeMatcher
- func AsPointerToMap() types.BeMatcher
- func AsPointerToObject() types.BeMatcher
- func AsPointerToSlice() types.BeMatcher
- func AsPointerToStruct() types.BeMatcher
- func AsReader() types.BeMatcher
- func AsSlice() types.BeMatcher
- func AsSliceOf[T any]() types.BeMatcher
- func AsString() types.BeMatcher
- func AsStringer() types.BeMatcher
- func AsStruct() types.BeMatcher
- func AssignableTo[T any]() types.BeMatcher
- func Implementing[T any]() types.BeMatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AsFinalPointer ¶
AsFinalPointer succeeds if the actual value is a final pointer, meaning it's a pointer to a non-pointer type.
func AsFloatish ¶
AsFloatish succeeds if actual is a numeric value that represents a floating-point value.
func AsFloatishString ¶
AsFloatishString succeeds if actual is a string that can be parsed into a valid floating-point value.
func AsIntish ¶
AsIntish succeeds if actual is a numeric value that represents an integer (from reflect.Int up to reflect.Uint64).
func AsIntishString ¶
AsIntishString succeeds if actual is a string that can be parsed into a valid integer value.
func AsKind ¶
AsKind succeeds if actual is assignable to any of the specified kinds or matches the provided matchers.
func AsNumeric ¶
AsNumeric succeeds if actual is a numeric value, supporting various integer kinds: reflect.Int, ... reflect.Int64, and floating-point kinds: reflect.Float32, reflect.Float64
func AsNumericString ¶
AsNumericString succeeds if actual is a string that can be parsed into a valid numeric value.
func AsObject ¶
AsObject is more specific than AsMap. It checks if the given `actual` value is a map with string keys and values of any type. This is particularly useful in the context of BeJson matcher, where the term 'Object' aligns with JSON notation.
func AsPointerToMap ¶
AsPointerToMap succeeds if actual is a pointer to a map.
func AsPointerToObject ¶
AsPointerToObject succeeds if actual is a pointer to a value that matches AsObject after applying dereference.
func AsPointerToSlice ¶
AsPointerToSlice succeeds if actual is a pointer to a slice.
func AsPointerToStruct ¶
AsPointerToStruct succeeds if actual is a pointer to a struct.
func AsSliceOf ¶
AsSliceOf succeeds if actual is of kind reflect.Slice and each element of the slice is assignable to the specified type T.
func AsStringer ¶
AsStringer succeeds if actual implements the fmt.Stringer interface.
func AssignableTo ¶
AssignableTo succeeds if actual is assignable to the specified type T.
func Implementing ¶
Implementing succeeds if actual implements the specified interface type T.
Types ¶
This section is empty.