Documentation
¶
Index ¶
- func GetBigInt(props map[string]interface{}, prop string) (*big.Int, error)
- func GetBigIntOrDefault(props map[string]interface{}, prop string, defaultValue *big.Int) *big.Int
- func GetBigIntPropOrDefault(props map[string]interface{}, prop string, defaultValue int64) int64
- func GetBigIntPropOrDefaultFunction(props map[string]interface{}, prop string, defaultFunction func() int64) int64
- func GetBigIntPropOrThrow(props map[string]interface{}, prop string, message ...string) int64
- func GetBoolean(props map[string]interface{}, prop string) (bool, error)
- func GetBooleanArray(props map[string]interface{}, prop string) ([]bool, error)
- func GetBooleanArrayOrDefault(props map[string]interface{}, prop string, defaultValue []bool) []bool
- func GetBooleanArrayPtr(props map[string]interface{}, prop string) (*[]bool, error)
- func GetBooleanArrayPtrOrDefault(props map[string]interface{}, prop string, defaultValue *[]bool) *[]bool
- func GetBooleanFunctionPropOrDefault(props map[string]interface{}, prop string, ...) bool
- func GetBooleanFunctionPropOrDefaultFunction(props map[string]interface{}, prop string, ...) bool
- func GetBooleanOrDefault(props map[string]interface{}, prop string, defaultValue bool) bool
- func GetBooleanPointerArray(props map[string]interface{}, prop string) ([]*bool, error)
- func GetBooleanPointerArrayPtr(props map[string]interface{}, prop string) (*[]*bool, error)
- func GetBooleanPropOrDefault(props map[string]interface{}, prop string, defaultValue bool) bool
- func GetBooleanPropOrDefaultFunction(props map[string]interface{}, prop string, defaultFunction func() bool) bool
- func GetBooleanPropOrThrow(props map[string]interface{}, prop string, message ...string) bool
- func GetBooleanPtr(props map[string]interface{}, prop string) (*bool, error)
- func GetBooleanPtrOrDefault(props map[string]interface{}, prop string, defaultValue *bool) *bool
- func GetDate(props map[string]interface{}, prop string) (time.Time, error)
- func GetDateArray(props map[string]interface{}, prop string) ([]time.Time, error)
- func GetDateArrayOrDefault(props map[string]interface{}, prop string, defaultValue []time.Time) []time.Time
- func GetDateArrayPropOrDefault(props map[string]interface{}, prop string, defaultValue []time.Time) []time.Time
- func GetDateArrayPtr(props map[string]interface{}, prop string) (*[]time.Time, error)
- func GetDateArrayPtrOrDefault(props map[string]interface{}, prop string, defaultValue *[]time.Time) *[]time.Time
- func GetDateOrDefault(props map[string]interface{}, prop string, defaultValue time.Time) time.Time
- func GetDatePointerArray(props map[string]interface{}, prop string) ([]*time.Time, error)
- func GetDatePointerArrayPtr(props map[string]interface{}, prop string) (*[]*time.Time, error)
- func GetDatePropOrDefault(props map[string]interface{}, prop string, defaultValue time.Time) time.Time
- func GetDatePropOrDefaultFunction(props map[string]interface{}, prop string, defaultFunction func() time.Time) time.Time
- func GetDatePropOrThrow(props map[string]interface{}, prop string, message ...string) time.Time
- func GetDatePtr(props map[string]interface{}, prop string) (*time.Time, error)
- func GetDatePtrOrDefault(props map[string]interface{}, prop string, defaultValue *time.Time) *time.Time
- func GetMap[K comparable, V any](props map[string]interface{}, prop string) (map[K]V, error)
- func GetMapPropOrDefault[K comparable, V any](props map[string]interface{}, prop string, defaultValue map[K]V) map[K]V
- func GetNumber[T NumberConstraint](props map[string]interface{}, prop string) (T, error)
- func GetNumberArray[T NumberConstraint](props map[string]interface{}, prop string) ([]T, error)
- func GetNumberArrayOrDefault[T NumberConstraint](props map[string]interface{}, prop string, defaultValue []T) []T
- func GetNumberArrayPtr[T NumberConstraint](props map[string]interface{}, prop string) (*[]T, error)
- func GetNumberArrayPtrOrDefault[T NumberConstraint](props map[string]interface{}, prop string, defaultValue *[]T) *[]T
- func GetNumberOrDefault[T NumberConstraint](props map[string]interface{}, prop string, defaultValue T) T
- func GetNumberPointerArray[T NumberConstraint](props map[string]interface{}, prop string) ([]*T, error)
- func GetNumberPointerArrayPtr[T NumberConstraint](props map[string]interface{}, prop string) (*[]*T, error)
- func GetNumberPropOrDefault[T NumberConstraint](props map[string]interface{}, prop string, defaultValue T) T
- func GetNumberPropOrDefaultFunction[T NumberConstraint](props map[string]interface{}, prop string, defaultFunction func() T) T
- func GetNumberPropOrThrow[T NumberConstraint](props map[string]interface{}, prop string, message ...string) T
- func GetNumberPtr[T NumberConstraint](props map[string]interface{}, prop string) (*T, error)
- func GetNumberPtrOrDefault[T NumberConstraint](props map[string]interface{}, prop string, defaultValue *T) *T
- func GetObject[T any](props map[string]interface{}, prop string) (T, error)
- func GetObjectArray[T any](props map[string]interface{}, prop string) ([]T, error)
- func GetObjectArrayFunctionPropOrDefault[T any](props map[string]interface{}, prop string, ...) []T
- func GetObjectArrayOrDefault[T any](props map[string]interface{}, prop string, defaultValue []T) []T
- func GetObjectArrayPropOrDefault[T any](props map[string]interface{}, prop string, defaultValue []T) []T
- func GetObjectArrayPtr[T any](props map[string]interface{}, prop string) (*[]T, error)
- func GetObjectArrayPtrOrDefault[T any](props map[string]interface{}, prop string, defaultValue *[]T) *[]T
- func GetObjectFunctionPropOrDefault[T any](props map[string]interface{}, prop string, ...) T
- func GetObjectFunctionPropOrThrow[T any](props map[string]interface{}, prop string, ...) T
- func GetObjectOrDefault[T any](props map[string]interface{}, prop string, defaultValue T) T
- func GetObjectPointerArray[T any](props map[string]interface{}, prop string) ([]*T, error)
- func GetObjectPointerArrayPtr[T any](props map[string]interface{}, prop string) (*[]*T, error)
- func GetObjectPropOrDefault[T any](props map[string]interface{}, prop string, defaultValue T) T
- func GetObjectPropOrDefaultAllowNull[T any](props map[string]interface{}, prop string, defaultValue T) *T
- func GetObjectPropOrThrow[T any](props map[string]interface{}, prop string, message ...string) T
- func GetObjectPtr[T any](props map[string]interface{}, prop string) (*T, error)
- func GetObjectPtrOrDefault[T any](props map[string]interface{}, prop string, defaultValue *T) *T
- func GetString(props map[string]interface{}, prop string) (string, error)
- func GetStringArray(props map[string]interface{}, prop string) ([]string, error)
- func GetStringArrayOrDefault(props map[string]interface{}, prop string, defaultValue []string) []string
- func GetStringArrayPropOrDefault(props map[string]interface{}, prop string, defaultValue []string) []string
- func GetStringArrayPropOrThrow(props map[string]interface{}, prop string, message ...string) []string
- func GetStringArrayPtr(props map[string]interface{}, prop string) (*[]string, error)
- func GetStringArrayPtrOrDefault(props map[string]interface{}, prop string, defaultValue *[]string) *[]string
- func GetStringOrDefault(props map[string]interface{}, prop string, defaultValue string) string
- func GetStringPointerArray(props map[string]interface{}, prop string) ([]*string, error)
- func GetStringPointerArrayPtr(props map[string]interface{}, prop string) (*[]*string, error)
- func GetStringPropOrDefault(props map[string]interface{}, prop string, defaultValue string) string
- func GetStringPropOrDefaultFunction(props map[string]interface{}, prop string, defaultFunction func() string) string
- func GetStringPropOrThrow(props map[string]interface{}, prop string, message ...string) string
- func GetStringPtr(props map[string]interface{}, prop string) (*string, error)
- func GetStringPtrOrDefault(props map[string]interface{}, prop string, defaultValue *string) *string
- func GetStringRegex(props map[string]interface{}, prop string, expression string) (string, error)
- func GetStringRegexOrDefault(props map[string]interface{}, prop string, expression string, ...) string
- func GetStringRegexPtr(props map[string]interface{}, prop string, expression string) (*string, error)
- func GetStringRegexPtrOrDefault(props map[string]interface{}, prop string, expression string, ...) *string
- func MustGetBigInt(props map[string]interface{}, prop string) *big.Int
- func MustGetBoolean(props map[string]interface{}, prop string) bool
- func MustGetBooleanArray(props map[string]interface{}, prop string) []bool
- func MustGetBooleanArrayPtr(props map[string]interface{}, prop string) *[]bool
- func MustGetBooleanPtr(props map[string]interface{}, prop string) *bool
- func MustGetDate(props map[string]interface{}, prop string) time.Time
- func MustGetDateArray(props map[string]interface{}, prop string) []time.Time
- func MustGetDateArrayPtr(props map[string]interface{}, prop string) *[]time.Time
- func MustGetDatePtr(props map[string]interface{}, prop string) *time.Time
- func MustGetMap[K comparable, V any](props map[string]interface{}, prop string) map[K]V
- func MustGetNumber[T NumberConstraint](props map[string]interface{}, prop string) T
- func MustGetNumberArray[T NumberConstraint](props map[string]interface{}, prop string) []T
- func MustGetNumberArrayPtr[T NumberConstraint](props map[string]interface{}, prop string) *[]T
- func MustGetNumberPtr[T NumberConstraint](props map[string]interface{}, prop string) *T
- func MustGetObject[T any](props map[string]interface{}, prop string) T
- func MustGetObjectArray[T any](props map[string]interface{}, prop string) []T
- func MustGetObjectArrayPtr[T any](props map[string]interface{}, prop string) *[]T
- func MustGetObjectPtr[T any](props map[string]interface{}, prop string) *T
- func MustGetString(props map[string]interface{}, prop string) string
- func MustGetStringArray(props map[string]interface{}, prop string) []string
- func MustGetStringArrayPtr(props map[string]interface{}, prop string) *[]string
- func MustGetStringPtr(props map[string]interface{}, prop string) *string
- func MustGetStringRegex(props map[string]interface{}, prop string, expression string) string
- func MustGetStringRegexPtr(props map[string]interface{}, prop string, expression string) *string
- type InvalidTypeError
- type MissingFieldError
- type NumberConstraint
- type RegexMismatchError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBigInt ¶
GetBigInt retrieves a big.Int property. It supports strings, int64, float64 (if integer).
func GetBigIntOrDefault ¶
GetBigIntOrDefault retrieves a big.Int property or returns a default value.
func GetBigIntPropOrDefault ¶
GetBigIntPropOrDefault aliases GetNumberOrDefault[int64]
func GetBigIntPropOrDefaultFunction ¶
func GetBigIntPropOrDefaultFunction(props map[string]interface{}, prop string, defaultFunction func() int64) int64
GetBigIntPropOrDefaultFunction
func GetBigIntPropOrThrow ¶
GetBigIntPropOrThrow
func GetBoolean ¶
GetBoolean retrieves a boolean property.
func GetBooleanArray ¶
GetBooleanArray retrieves a boolean array property.
func GetBooleanArrayOrDefault ¶
func GetBooleanArrayOrDefault(props map[string]interface{}, prop string, defaultValue []bool) []bool
GetBooleanArrayOrDefault retrieves a boolean array property or returns a default value.
func GetBooleanArrayPtr ¶
GetBooleanArrayPtr retrieves a boolean array property as a pointer.
func GetBooleanArrayPtrOrDefault ¶
func GetBooleanArrayPtrOrDefault(props map[string]interface{}, prop string, defaultValue *[]bool) *[]bool
GetBooleanArrayPtrOrDefault retrieves a boolean array property as a pointer or returns a default value.
func GetBooleanFunctionPropOrDefault ¶
func GetBooleanFunctionPropOrDefault(props map[string]interface{}, prop string, constructorFunc func(interface{}) bool, defaultValue bool) bool
GetBooleanFunctionPropOrDefault constructs a boolean using a function or returns default.
func GetBooleanFunctionPropOrDefaultFunction ¶
func GetBooleanFunctionPropOrDefaultFunction(props map[string]interface{}, prop string, constructorFunc func(interface{}) bool, defaultFunction func() bool) bool
GetBooleanFunctionPropOrDefaultFunction
func GetBooleanOrDefault ¶
GetBooleanOrDefault retrieves a boolean property or returns a default value.
func GetBooleanPointerArray ¶
GetBooleanPointerArray retrieves a property as a slice of boolean pointers.
func GetBooleanPointerArrayPtr ¶
GetBooleanPointerArrayPtr retrieves a property as a pointer to a slice of boolean pointers.
func GetBooleanPropOrDefault ¶
GetBooleanPropOrDefault is an alias for GetBooleanOrDefault.
func GetBooleanPropOrDefaultFunction ¶
func GetBooleanPropOrDefaultFunction(props map[string]interface{}, prop string, defaultFunction func() bool) bool
GetBooleanPropOrDefaultFunction retrieves a boolean property or returns a value from a default function.
func GetBooleanPropOrThrow ¶
GetBooleanPropOrThrow retrieves a boolean property or panics if missing/invalid.
func GetBooleanPtr ¶
GetBooleanPtr retrieves a boolean property as a pointer.
func GetBooleanPtrOrDefault ¶
GetBooleanPtrOrDefault retrieves a boolean property as a pointer or returns a default value.
func GetDateArray ¶
GetDateArray retrieves a date array property.
func GetDateArrayOrDefault ¶
func GetDateArrayOrDefault(props map[string]interface{}, prop string, defaultValue []time.Time) []time.Time
GetDateArrayOrDefault retrieves a date array property or returns a default value.
func GetDateArrayPropOrDefault ¶
func GetDateArrayPropOrDefault(props map[string]interface{}, prop string, defaultValue []time.Time) []time.Time
GetDateArrayPropOrDefault
func GetDateArrayPtr ¶
GetDateArrayPtr retrieves a date array property as a pointer.
func GetDateArrayPtrOrDefault ¶
func GetDateArrayPtrOrDefault(props map[string]interface{}, prop string, defaultValue *[]time.Time) *[]time.Time
GetDateArrayPtrOrDefault retrieves a date array property as a pointer or returns a default value.
func GetDateOrDefault ¶
GetDateOrDefault retrieves a date property or returns a default value.
func GetDatePointerArray ¶
GetDatePointerArray retrieves a property as a slice of date pointers.
func GetDatePointerArrayPtr ¶
GetDatePointerArrayPtr retrieves a property as a pointer to a slice of date pointers.
func GetDatePropOrDefault ¶
func GetDatePropOrDefault(props map[string]interface{}, prop string, defaultValue time.Time) time.Time
GetDatePropOrDefault is an alias for GetDateOrDefault.
func GetDatePropOrDefaultFunction ¶
func GetDatePropOrDefaultFunction(props map[string]interface{}, prop string, defaultFunction func() time.Time) time.Time
GetDatePropOrDefaultFunction
func GetDatePropOrThrow ¶
GetDatePropOrThrow
func GetDatePtr ¶
GetDatePtr retrieves a date property as a pointer.
func GetDatePtrOrDefault ¶
func GetDatePtrOrDefault(props map[string]interface{}, prop string, defaultValue *time.Time) *time.Time
GetDatePtrOrDefault retrieves a date property as a pointer or returns a default value.
func GetMap ¶
func GetMap[K comparable, V any](props map[string]interface{}, prop string) (map[K]V, error)
GetMap retrieves a map property.
func GetMapPropOrDefault ¶
func GetMapPropOrDefault[K comparable, V any](props map[string]interface{}, prop string, defaultValue map[K]V) map[K]V
GetMapPropOrDefault
func GetNumber ¶
func GetNumber[T NumberConstraint](props map[string]interface{}, prop string) (T, error)
GetNumber retrieves a numeric property.
func GetNumberArray ¶
func GetNumberArray[T NumberConstraint](props map[string]interface{}, prop string) ([]T, error)
GetNumberArray retrieves a number array property.
func GetNumberArrayOrDefault ¶
func GetNumberArrayOrDefault[T NumberConstraint](props map[string]interface{}, prop string, defaultValue []T) []T
GetNumberArrayOrDefault retrieves a number array property or returns a default value.
func GetNumberArrayPtr ¶
func GetNumberArrayPtr[T NumberConstraint](props map[string]interface{}, prop string) (*[]T, error)
GetNumberArrayPtr retrieves a number array property as a pointer.
func GetNumberArrayPtrOrDefault ¶
func GetNumberArrayPtrOrDefault[T NumberConstraint](props map[string]interface{}, prop string, defaultValue *[]T) *[]T
GetNumberArrayPtrOrDefault retrieves a number array property as a pointer or returns a default value.
func GetNumberOrDefault ¶
func GetNumberOrDefault[T NumberConstraint](props map[string]interface{}, prop string, defaultValue T) T
GetNumberOrDefault retrieves a numeric property or returns a default value.
func GetNumberPointerArray ¶
func GetNumberPointerArray[T NumberConstraint](props map[string]interface{}, prop string) ([]*T, error)
GetNumberPointerArray retrieves a property as a slice of number pointers.
func GetNumberPointerArrayPtr ¶
func GetNumberPointerArrayPtr[T NumberConstraint](props map[string]interface{}, prop string) (*[]*T, error)
GetNumberPointerArrayPtr retrieves a property as a pointer to a slice of number pointers.
func GetNumberPropOrDefault ¶
func GetNumberPropOrDefault[T NumberConstraint](props map[string]interface{}, prop string, defaultValue T) T
GetNumberPropOrDefault is an alias for GetNumberOrDefault.
func GetNumberPropOrDefaultFunction ¶
func GetNumberPropOrDefaultFunction[T NumberConstraint](props map[string]interface{}, prop string, defaultFunction func() T) T
GetNumberPropOrDefaultFunction retrieves a numeric property or returns a value from a default function.
func GetNumberPropOrThrow ¶
func GetNumberPropOrThrow[T NumberConstraint](props map[string]interface{}, prop string, message ...string) T
GetNumberPropOrThrow retrieves a numeric property or panics if missing/invalid.
func GetNumberPtr ¶
func GetNumberPtr[T NumberConstraint](props map[string]interface{}, prop string) (*T, error)
GetNumberPtr retrieves a numeric property as a pointer.
func GetNumberPtrOrDefault ¶
func GetNumberPtrOrDefault[T NumberConstraint](props map[string]interface{}, prop string, defaultValue *T) *T
GetNumberPtrOrDefault retrieves a numeric property as a pointer or returns a default value.
func GetObjectArray ¶
GetObjectArray retrieves an object array property.
func GetObjectArrayFunctionPropOrDefault ¶
func GetObjectArrayFunctionPropOrDefault[T any](props map[string]interface{}, prop string, constructorFunc func(map[string]interface{}) T, defaultValue []T) []T
GetObjectArrayFunctionPropOrDefault
func GetObjectArrayOrDefault ¶
func GetObjectArrayOrDefault[T any](props map[string]interface{}, prop string, defaultValue []T) []T
GetObjectArrayOrDefault retrieves an object array property or returns a default value.
func GetObjectArrayPropOrDefault ¶
func GetObjectArrayPropOrDefault[T any](props map[string]interface{}, prop string, defaultValue []T) []T
GetObjectArrayPropOrDefault
func GetObjectArrayPtr ¶
GetObjectArrayPtr retrieves an object array property as a pointer.
func GetObjectArrayPtrOrDefault ¶
func GetObjectArrayPtrOrDefault[T any](props map[string]interface{}, prop string, defaultValue *[]T) *[]T
GetObjectArrayPtrOrDefault retrieves an object array property as a pointer or returns a default value.
func GetObjectFunctionPropOrDefault ¶
func GetObjectFunctionPropOrDefault[T any](props map[string]interface{}, prop string, constructorFunc func(map[string]interface{}) T, defaultValue T) T
GetObjectFunctionPropOrDefault uses a constructor function.
func GetObjectFunctionPropOrThrow ¶
func GetObjectFunctionPropOrThrow[T any](props map[string]interface{}, prop string, constructorFunc func(map[string]interface{}) T, message ...string) T
GetObjectFunctionPropOrThrow
func GetObjectOrDefault ¶
GetObjectOrDefault retrieves an object property or returns a default value.
func GetObjectPointerArray ¶
GetObjectPointerArray retrieves a property as a slice of object pointers.
func GetObjectPointerArrayPtr ¶
GetObjectPointerArrayPtr retrieves a property as a pointer to a slice of object pointers.
func GetObjectPropOrDefault ¶
GetObjectPropOrDefault
func GetObjectPropOrDefaultAllowNull ¶
func GetObjectPropOrDefaultAllowNull[T any](props map[string]interface{}, prop string, defaultValue T) *T
GetObjectPropOrDefaultAllowNull
func GetObjectPropOrThrow ¶
GetObjectPropOrThrow
func GetObjectPtr ¶
GetObjectPtr retrieves an object property as a pointer.
func GetObjectPtrOrDefault ¶
GetObjectPtrOrDefault retrieves an object property as a pointer or returns a default value.
func GetString ¶
GetString retrieves a string property. It returns an error if the property is missing or not a string.
func GetStringArray ¶
GetStringArray retrieves a string array property.
func GetStringArrayOrDefault ¶
func GetStringArrayOrDefault(props map[string]interface{}, prop string, defaultValue []string) []string
GetStringArrayOrDefault retrieves a string array property or returns a default value.
func GetStringArrayPropOrDefault ¶
func GetStringArrayPropOrDefault(props map[string]interface{}, prop string, defaultValue []string) []string
GetStringArrayPropOrDefault
func GetStringArrayPropOrThrow ¶
func GetStringArrayPropOrThrow(props map[string]interface{}, prop string, message ...string) []string
GetStringArrayPropOrThrow
func GetStringArrayPtr ¶
GetStringArrayPtr retrieves a string array property as a pointer.
func GetStringArrayPtrOrDefault ¶
func GetStringArrayPtrOrDefault(props map[string]interface{}, prop string, defaultValue *[]string) *[]string
GetStringArrayPtrOrDefault retrieves a string array property as a pointer or returns a default value.
func GetStringOrDefault ¶
GetStringOrDefault retrieves a string property or returns a default value.
func GetStringPointerArray ¶
GetStringPointerArray retrieves a property as a slice of string pointers.
func GetStringPointerArrayPtr ¶
GetStringPointerArrayPtr retrieves a property as a pointer to a slice of string pointers.
func GetStringPropOrDefault ¶
GetStringPropOrDefault is an alias for GetStringOrDefault
func GetStringPropOrDefaultFunction ¶
func GetStringPropOrDefaultFunction(props map[string]interface{}, prop string, defaultFunction func() string) string
GetStringPropOrDefaultFunction retrieves a string property or returns a value from a default function.
func GetStringPropOrThrow ¶
GetStringPropOrThrow behaves like MustGetString but allows a custom message.
func GetStringPtr ¶
GetStringPtr retrieves a string property as a pointer.
func GetStringPtrOrDefault ¶
GetStringPtrOrDefault retrieves a string property as a pointer or returns a default value.
func GetStringRegex ¶ added in v0.1.3
GetStringRegex retrieves a string property and validates it against a regular expression. It returns an error if the property is missing, not a string, the regex is invalid, or the value doesn't match.
func GetStringRegexOrDefault ¶ added in v0.1.3
func GetStringRegexOrDefault(props map[string]interface{}, prop string, expression string, defaultValue string) string
GetStringRegexOrDefault retrieves a string property validated against a regex or returns a default value.
func GetStringRegexPtr ¶ added in v0.1.3
func GetStringRegexPtr(props map[string]interface{}, prop string, expression string) (*string, error)
GetStringRegexPtr retrieves a string property as a pointer and validates it against a regular expression.
func GetStringRegexPtrOrDefault ¶ added in v0.1.3
func GetStringRegexPtrOrDefault(props map[string]interface{}, prop string, expression string, defaultValue *string) *string
GetStringRegexPtrOrDefault retrieves a string property as a pointer validated against a regex or returns a default value.
func MustGetBigInt ¶
MustGetBigInt retrieves a big.Int property or panics.
func MustGetBoolean ¶
MustGetBoolean retrieves a boolean property or panics.
func MustGetBooleanArray ¶
MustGetBooleanArray retrieves a boolean array property or panics.
func MustGetBooleanArrayPtr ¶
MustGetBooleanArrayPtr retrieves a boolean array property as a pointer or panics.
func MustGetBooleanPtr ¶
MustGetBooleanPtr retrieves a boolean property as a pointer or panics.
func MustGetDate ¶
MustGetDate retrieves a date property or panics.
func MustGetDateArray ¶
MustGetDateArray retrieves a date array property or panics.
func MustGetDateArrayPtr ¶
MustGetDateArrayPtr retrieves a date array property as a pointer or panics.
func MustGetDatePtr ¶
MustGetDatePtr retrieves a date property as a pointer or panics.
func MustGetMap ¶
func MustGetMap[K comparable, V any](props map[string]interface{}, prop string) map[K]V
MustGetMap retrieves a map property or panics.
func MustGetNumber ¶
func MustGetNumber[T NumberConstraint](props map[string]interface{}, prop string) T
MustGetNumber retrieves a numeric property or panics.
func MustGetNumberArray ¶
func MustGetNumberArray[T NumberConstraint](props map[string]interface{}, prop string) []T
MustGetNumberArray retrieves a number array property or panics.
func MustGetNumberArrayPtr ¶
func MustGetNumberArrayPtr[T NumberConstraint](props map[string]interface{}, prop string) *[]T
MustGetNumberArrayPtr retrieves a number array property as a pointer or panics.
func MustGetNumberPtr ¶
func MustGetNumberPtr[T NumberConstraint](props map[string]interface{}, prop string) *T
MustGetNumberPtr retrieves a numeric property as a pointer or panics.
func MustGetObject ¶
MustGetObject retrieves an object property or panics.
func MustGetObjectArray ¶
MustGetObjectArray retrieves an object array property or panics.
func MustGetObjectArrayPtr ¶
MustGetObjectArrayPtr retrieves an object array property as a pointer or panics.
func MustGetObjectPtr ¶
MustGetObjectPtr retrieves an object property as a pointer or panics.
func MustGetString ¶
MustGetString retrieves a string property or panics.
func MustGetStringArray ¶
MustGetStringArray retrieves a string array property or panics.
func MustGetStringArrayPtr ¶
MustGetStringArrayPtr retrieves a string array property as a pointer or panics.
func MustGetStringPtr ¶
MustGetStringPtr retrieves a string property as a pointer or panics.
func MustGetStringRegex ¶ added in v0.1.3
MustGetStringRegex retrieves a string property validated against a regex or panics.
Types ¶
type InvalidTypeError ¶
InvalidTypeError indicates that a field exists but is not of the expected type.
func (*InvalidTypeError) Error ¶
func (e *InvalidTypeError) Error() string
func (*InvalidTypeError) Unwrap ¶
func (e *InvalidTypeError) Unwrap() error
type MissingFieldError ¶
type MissingFieldError struct {
Prop string
}
MissingFieldError indicates that a required field is missing from the map.
func (*MissingFieldError) Error ¶
func (e *MissingFieldError) Error() string
type NumberConstraint ¶
type NumberConstraint interface {
~int | ~int8 | ~int16 | ~int32 | ~int64 |
~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 |
~float32 | ~float64
}
NumberConstraint defines numeric types that we can return.
type RegexMismatchError ¶ added in v0.1.3
RegexMismatchError indicates that a string field does not match the expected regular expression.
func (*RegexMismatchError) Error ¶ added in v0.1.3
func (e *RegexMismatchError) Error() string