Documentation ¶
Index ¶
- func DebugJSONAttributes(data map[string]any, isDebug bool) []attribute.KeyValue
- func DecodeArbitraryJSONPtrSlice(value any) ([]*any, error)
- func DecodeArbitraryJSONSlice(value any) ([]any, error)
- func DecodeBoolean(value any) (bool, error)
- func DecodeBooleanPtrSlice(value any) ([]*bool, error)
- func DecodeBooleanSlice(value any) ([]bool, error)
- func DecodeDateTime(value any) (time.Time, error)
- func DecodeDateTimePtrSlice(value any) ([]*time.Time, error)
- func DecodeDateTimeSlice(value any) ([]time.Time, error)
- func DecodeDuration(value any) (time.Duration, error)
- func DecodeFloat[T float32 | float64](value any) (T, error)
- func DecodeFloatPtrSlice[T float32 | float64](value any) ([]*T, error)
- func DecodeFloatSlice[T float32 | float64](value any) ([]T, error)
- func DecodeInt[T int | int8 | int16 | int32 | int64](value any) (T, error)
- func DecodeIntPtrSlice[T int | int8 | int16 | int32 | int64](value any) ([]*T, error)
- func DecodeIntSlice[T int | int8 | int16 | int32 | int64](value any) ([]T, error)
- func DecodeNullableArbitraryJSONPtrSlice(value any) (*[]*any, error)
- func DecodeNullableArbitraryJSONSlice(value any) (*[]any, error)
- func DecodeNullableBoolean(value any) (*bool, error)
- func DecodeNullableBooleanPtrSlice(value any) (*[]*bool, error)
- func DecodeNullableBooleanSlice(value any) (*[]bool, error)
- func DecodeNullableDateTime(value any) (*time.Time, error)
- func DecodeNullableDateTimePtrSlice(value any) (*[]*time.Time, error)
- func DecodeNullableDateTimeSlice(value any) (*[]time.Time, error)
- func DecodeNullableDuration(value any) (*time.Duration, error)
- func DecodeNullableFloat[T float32 | float64](value any) (*T, error)
- func DecodeNullableFloatPtrSlice[T float32 | float64](value any) (*[]*T, error)
- func DecodeNullableFloatSlice[T float32 | float64](value any) (*[]T, error)
- func DecodeNullableInt[T int | int8 | int16 | int32 | int64](value any) (*T, error)
- func DecodeNullableIntPtrSlice[T int | int8 | int16 | int32 | int64](value any) (*[]*T, error)
- func DecodeNullableIntSlice[T int | int8 | int16 | int32 | int64](value any) (*[]T, error)
- func DecodeNullableRawJSON(value any) (*json.RawMessage, error)
- func DecodeNullableRawJSONPtrSlice(value any) (*[]*json.RawMessage, error)
- func DecodeNullableRawJSONSlice(value any) (*[]json.RawMessage, error)
- func DecodeNullableString(value any) (*string, error)
- func DecodeNullableStringPtrSlice(value any) (*[]*string, error)
- func DecodeNullableStringSlice(value any) (*[]string, error)
- func DecodeNullableUUID(value any) (*uuid.UUID, error)
- func DecodeNullableUUIDPtrSlice(value any) (*[]*uuid.UUID, error)
- func DecodeNullableUUIDSlice(value any) (*[]uuid.UUID, error)
- func DecodeNullableUint[T uint | uint8 | uint16 | uint32 | uint64](value any) (*T, error)
- func DecodeNullableUintPtrSlice[T uint | uint8 | uint16 | uint32 | uint64](value any) (*[]*T, error)
- func DecodeNullableUintSlice[T uint | uint8 | uint16 | uint32 | uint64](value any) (*[]T, error)
- func DecodeRawJSONPtrSlice(value any) ([]*json.RawMessage, error)
- func DecodeRawJSONSlice(value any) ([]json.RawMessage, error)
- func DecodeString(value any) (string, error)
- func DecodeStringPtrSlice(value any) ([]*string, error)
- func DecodeStringSlice(value any) ([]string, error)
- func DecodeUUID(value any) (uuid.UUID, error)
- func DecodeUUIDPtrSlice(value any) ([]*uuid.UUID, error)
- func DecodeUUIDSlice(value any) ([]uuid.UUID, error)
- func DecodeUint[T uint | uint8 | uint16 | uint32 | uint64](value any) (T, error)
- func DecodeUintPtrSlice[T uint | uint8 | uint16 | uint32 | uint64](value any) ([]*T, error)
- func DecodeUintSlice[T uint | uint8 | uint16 | uint32 | uint64](value any) ([]T, error)
- func EncodeMap[T MapEncoder](input T) map[string]anydeprecated
- func EncodeMaps[T MapEncoder](inputs []T) []map[string]anydeprecated
- func EncodeNullableMaps[T MapEncoder](inputs *[]T) []map[string]anydeprecated
- func EncodeNullableObjectSlice[T any](inputs *[]T) ([]map[string]any, error)
- func EncodeObject(input any) (map[string]any, error)
- func EncodeObjectSlice[T any](input []T) ([]map[string]any, error)
- func EncodeObjectWithColumnSelection[T any](fields map[string]schema.Field, data T) (map[string]any, error)
- func EncodeObjects(input any) ([]map[string]any, error)
- func EncodeObjectsWithColumnSelection[T any](fields map[string]schema.Field, data []T) ([]map[string]any, error)
- func EvalFunctionSelectionFieldValue(request *schema.QueryRequest) (schema.NestedField, error)
- func EvalNestedColumnArray(fields *schema.NestedArray, value any) (any, error)
- func EvalNestedColumnArrayIntoSlice[T any](fields *schema.NestedArray, value []T) (any, error)
- func EvalNestedColumnFields(fields schema.NestedField, value any) (any, error)
- func EvalNestedColumnObject(fields *schema.NestedObject, value any) (any, error)
- func EvalObjectWithColumnSelection(fields map[string]schema.Field, data map[string]any) (map[string]any, error)
- func EvalObjectsWithColumnSelection(fields map[string]schema.Field, data []map[string]any) ([]map[string]any, error)
- func GetAny(object map[string]any, key string) (any, bool)
- func GetArbitraryJSON(object map[string]any, key string) (any, error)
- func GetArbitraryJSONPtrSlice(object map[string]any, key string) ([]*any, error)
- func GetArbitraryJSONSlice(object map[string]any, key string) ([]any, error)
- func GetBoolean(object map[string]any, key string) (bool, error)
- func GetBooleanPtrSlice(object map[string]any, key string) ([]*bool, error)
- func GetBooleanSlice(object map[string]any, key string) ([]bool, error)
- func GetDateTime(object map[string]any, key string) (time.Time, error)
- func GetDateTimePtrSlice(object map[string]any, key string) ([]*time.Time, error)
- func GetDateTimeSlice(object map[string]any, key string) ([]time.Time, error)
- func GetDefault[T comparable](value T, defaultValue T) T
- func GetDefaultPtr[T any](value *T, defaultValue *T) *T
- func GetDefaultValuePtr[T comparable](value *T, defaultValue T) T
- func GetDuration(object map[string]any, key string) (time.Duration, error)
- func GetFloat[T float32 | float64](object map[string]any, key string) (T, error)
- func GetFloatPtrSlice[T float32 | float64](object map[string]any, key string) ([]*T, error)
- func GetFloatSlice[T float32 | float64](object map[string]any, key string) ([]T, error)
- func GetInt[T int | int8 | int16 | int32 | int64](object map[string]any, key string) (T, error)
- func GetIntPtrSlice[T int | int8 | int16 | int32 | int64](object map[string]any, key string) ([]*T, error)
- func GetIntSlice[T int | int8 | int16 | int32 | int64](object map[string]any, key string) ([]T, error)
- func GetNullableArbitraryJSON(object map[string]any, key string) (*any, error)
- func GetNullableArbitraryJSONPtrSlice(object map[string]any, key string) (*[]*any, error)
- func GetNullableArbitraryJSONSlice(object map[string]any, key string) (*[]any, error)
- func GetNullableBoolean(object map[string]any, key string) (*bool, error)
- func GetNullableBooleanPtrSlice(object map[string]any, key string) (*[]*bool, error)
- func GetNullableBooleanSlice(object map[string]any, key string) (*[]bool, error)
- func GetNullableDateTime(object map[string]any, key string) (*time.Time, error)
- func GetNullableDateTimePtrSlice(object map[string]any, key string) (*[]*time.Time, error)
- func GetNullableDateTimeSlice(object map[string]any, key string) (*[]time.Time, error)
- func GetNullableDuration(object map[string]any, key string) (*time.Duration, error)
- func GetNullableFloat[T float32 | float64](object map[string]any, key string) (*T, error)
- func GetNullableFloatPtrSlice[T float32 | float64](object map[string]any, key string) (*[]*T, error)
- func GetNullableFloatSlice[T float32 | float64](object map[string]any, key string) (*[]T, error)
- func GetNullableInt[T int | int8 | int16 | int32 | int64](object map[string]any, key string) (*T, error)
- func GetNullableIntPtrSlice[T int | int8 | int16 | int32 | int64](object map[string]any, key string) (*[]*T, error)
- func GetNullableIntSlice[T int | int8 | int16 | int32 | int64](object map[string]any, key string) (*[]T, error)
- func GetNullableRawJSON(object map[string]any, key string) (*json.RawMessage, error)
- func GetNullableRawJSONPtrSlice(object map[string]any, key string) (*[]*json.RawMessage, error)
- func GetNullableRawJSONSlice(object map[string]any, key string) (*[]json.RawMessage, error)
- func GetNullableString(object map[string]any, key string) (*string, error)
- func GetNullableStringPtrSlice(object map[string]any, key string) (*[]*string, error)
- func GetNullableStringSlice(object map[string]any, key string) (*[]string, error)
- func GetNullableUUID(object map[string]any, key string) (*uuid.UUID, error)
- func GetNullableUUIDPtrSlice(object map[string]any, key string) (*[]*uuid.UUID, error)
- func GetNullableUUIDSlice(object map[string]any, key string) (*[]uuid.UUID, error)
- func GetNullableUint[T uint | uint8 | uint16 | uint32 | uint64](object map[string]any, key string) (*T, error)
- func GetNullableUintPtrSlice[T uint | uint8 | uint16 | uint32 | uint64](object map[string]any, key string) (*[]*T, error)
- func GetNullableUintSlice[T uint | uint8 | uint16 | uint32 | uint64](object map[string]any, key string) (*[]T, error)
- func GetRawJSON(object map[string]any, key string) (json.RawMessage, error)
- func GetRawJSONPtrSlice(object map[string]any, key string) ([]*json.RawMessage, error)
- func GetRawJSONSlice(object map[string]any, key string) ([]json.RawMessage, error)
- func GetString(object map[string]any, key string) (string, error)
- func GetStringPtrSlice(object map[string]any, key string) ([]*string, error)
- func GetStringSlice(object map[string]any, key string) ([]string, error)
- func GetUUID(object map[string]any, key string) (uuid.UUID, error)
- func GetUUIDPtrSlice(object map[string]any, key string) ([]*uuid.UUID, error)
- func GetUUIDSlice(object map[string]any, key string) ([]uuid.UUID, error)
- func GetUint[T uint | uint8 | uint16 | uint32 | uint64](object map[string]any, key string) (T, error)
- func GetUintPtrSlice[T uint | uint8 | uint16 | uint32 | uint64](object map[string]any, key string) ([]*T, error)
- func GetUintSlice[T uint | uint8 | uint16 | uint32 | uint64](object map[string]any, key string) ([]T, error)
- func IsNil(value any) bool
- func JSONAttribute(key string, data any) attribute.KeyValue
- func PointersToValues[T any](input []*T) ([]T, error)
- func ResolveArgumentVariables(arguments map[string]schema.Argument, variables map[string]any) (map[string]any, error)
- func ToPtr[V any](value V) *V
- func ToPtrs[T any](input []T) []*T
- func UnwrapPointerFromAny(value any) (any, bool)
- func UnwrapPointerFromReflectValue(reflectValue reflect.Value) (reflect.Value, bool)
- type Decoder
- func (d Decoder) DecodeNullableObjectValue(target any, object map[string]any, key string) error
- func (d Decoder) DecodeNullableValue(target any, value any) error
- func (d Decoder) DecodeObjectValue(target any, object map[string]any, key string) error
- func (d Decoder) DecodeValue(target any, value any) error
- type MapEncoder
- type ObjectDecoder
- type Scalar
- type ValueDecoder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DebugJSONAttributes ¶ added in v0.3.0
DebugJSONAttributes create OpenTelemetry attributes with JSON data. They are only visible on debug mode
func DecodeArbitraryJSONPtrSlice ¶ added in v0.3.1
DecodeArbitraryJSONPtrSlice decodes an arbitrary json pointer slice from object by key
func DecodeArbitraryJSONSlice ¶ added in v0.3.1
DecodeArbitraryJSONSlice decodes an arbitrary json slice from object by key
func DecodeBoolean ¶
DecodeBoolean tries to convert an unknown value to a bool value
func DecodeBooleanPtrSlice ¶ added in v0.3.1
DecodeBooleanPtrSlice decodes a boolean pointer slice from an unknown value
func DecodeBooleanSlice ¶ added in v0.3.1
DecodeBooleanSlice decodes a boolean slice from an unknown value
func DecodeDateTime ¶
DecodeDateTime tries to convert an unknown value to a time.Time value
func DecodeDateTimePtrSlice ¶ added in v0.3.1
DecodeDateTimePtrSlice tries to convert an unknown value to a time.Time pointer slice
func DecodeDateTimeSlice ¶ added in v0.3.1
DecodeDateTimeSlice tries to convert an unknown value to a time.Time slice
func DecodeDuration ¶
DecodeDuration tries to convert an unknown value to a duration value
func DecodeFloat ¶
DecodeFloat tries to convert an unknown value to a float value
func DecodeFloatPtrSlice ¶ added in v0.3.1
DecodeFloatSlice decodes a float pointer slice from an unknown value
func DecodeFloatSlice ¶ added in v0.3.1
DecodeFloatSlice decodes a float slice from an unknown value
func DecodeIntPtrSlice ¶ added in v0.3.1
DecodeIntPtrSlice decodes an integer slice from an unknown value
func DecodeIntSlice ¶ added in v0.3.1
DecodeIntSlice decodes an integer slice from an unknown value
func DecodeNullableArbitraryJSONPtrSlice ¶ added in v0.3.1
DecodeNullableArbitraryJSONPtrSlice decodes a nullable arbitrary json pointer slice from object by key
func DecodeNullableArbitraryJSONSlice ¶ added in v0.3.1
DecodeNullableArbitraryJSONSlice decodes a nullable arbitrary json slice from object by key
func DecodeNullableBoolean ¶
DecodeNullableBoolean tries to convert an unknown value to a bool pointer
func DecodeNullableBooleanPtrSlice ¶ added in v0.3.1
DecodeNullableBooleanPtrSlice decodes a boolean pointer slice from an unknown value
func DecodeNullableBooleanSlice ¶ added in v0.3.1
DecodeNullableBooleanSlice decodes a nullable boolean slice from an unknown value
func DecodeNullableDateTime ¶
DecodeNullableDateTime tries to convert an unknown value to a time.Time pointer
func DecodeNullableDateTimePtrSlice ¶ added in v0.3.1
DecodeNullableDateTimePtrSlice tries to convert an unknown value to a nullable time.Time pointer slice
func DecodeNullableDateTimeSlice ¶ added in v0.3.1
DecodeNullableDateTimeSlice tries to convert an unknown value to a nullable time.Time slice
func DecodeNullableDuration ¶
DecodeNullableDuration tries to convert an unknown value to a duration pointer
func DecodeNullableFloat ¶
DecodeNullableFloat tries to convert an unknown value to a float pointer
func DecodeNullableFloatPtrSlice ¶ added in v0.3.1
DecodeNullableFloatPtrSlice decodes a float pointer slice from an unknown value
func DecodeNullableFloatSlice ¶ added in v0.3.1
DecodeNullableFloatSlice decodes a float slice from an unknown value
func DecodeNullableInt ¶
DecodeNullableInt tries to convert an unknown value to a nullable integer
func DecodeNullableIntPtrSlice ¶ added in v0.3.1
DecodeNullableIntPtrSlice decodes an integer pointer slice from an unknown value
func DecodeNullableIntSlice ¶ added in v0.3.1
DecodeNullableIntSlice decodes an integer pointer slice from an unknown value
func DecodeNullableRawJSON ¶ added in v0.3.1
func DecodeNullableRawJSON(value any) (*json.RawMessage, error)
DecodeNullableRawJSON decodes a raw json.RawMessage pointer from object by key
func DecodeNullableRawJSONPtrSlice ¶ added in v0.3.1
func DecodeNullableRawJSONPtrSlice(value any) (*[]*json.RawMessage, error)
DecodeNullableRawJSONPtrSlice decodes a nullable json.RawMessage pointer slice from object by key
func DecodeNullableRawJSONSlice ¶ added in v0.3.1
func DecodeNullableRawJSONSlice(value any) (*[]json.RawMessage, error)
DecodeNullableRawJSONSlice decodes a nullable json.RawMessage slice from object by key
func DecodeNullableString ¶
DecodeNullableString tries to convert an unknown value to a string pointer
func DecodeNullableStringPtrSlice ¶ added in v0.3.1
DecodeNullableStringSlice decodes a nullable string slice from an unknown value
func DecodeNullableStringSlice ¶ added in v0.3.1
DecodeNullableStringSlice decodes a nullable string slice from an unknown value
func DecodeNullableUUID ¶ added in v0.3.1
DecodeNullableUUID decodes UUID pointer from string or bytes
func DecodeNullableUUIDPtrSlice ¶ added in v0.3.1
DecodeNullableUUIDPtrSlice decodes UUID pointer slice from array string
func DecodeNullableUUIDSlice ¶ added in v0.3.1
DecodeNullableUUIDSlice decodes a nullable UUID slice from array string
func DecodeNullableUint ¶
DecodeNullableUint tries to convert an unknown value to a nullable unsigned integer pointer
func DecodeNullableUintPtrSlice ¶ added in v0.3.1
func DecodeNullableUintPtrSlice[T uint | uint8 | uint16 | uint32 | uint64](value any) (*[]*T, error)
DecodeNullableUintPtrSlice decodes an unsigned integer pointer slice from an unknown value
func DecodeNullableUintSlice ¶ added in v0.3.1
DecodeNullableUintSlice decodes an unsigned integer slice from an unknown value
func DecodeRawJSONPtrSlice ¶ added in v0.3.1
func DecodeRawJSONPtrSlice(value any) ([]*json.RawMessage, error)
DecodeRawJSONPtrSlice decodes a json.RawMessage pointer slice from object by key
func DecodeRawJSONSlice ¶ added in v0.3.1
func DecodeRawJSONSlice(value any) ([]json.RawMessage, error)
DecodeRawJSONSlice decodes a json.RawMessage slice from object by key
func DecodeString ¶
DecodeString tries to convert an unknown value to a string value
func DecodeStringPtrSlice ¶ added in v0.3.1
DecodeStringPtrSlice decodes a string pointer slice from an unknown value
func DecodeStringSlice ¶ added in v0.3.1
DecodeStringSlice decodes a string slice from an unknown value
func DecodeUUID ¶ added in v0.3.1
DecodeUUID decodes UUID from string
func DecodeUUIDPtrSlice ¶ added in v0.3.1
DecodeUUIDPtrSlice decodes UUID slice from array string
func DecodeUUIDSlice ¶ added in v0.3.1
DecodeUUIDSlice decodes UUID slice from array string
func DecodeUint ¶
DecodeUint tries to convert an unknown value to an unsigned integer value
func DecodeUintPtrSlice ¶ added in v0.3.1
DecodeUintSlice decodes an unsigned integer pointer slice from an unknown value
func DecodeUintSlice ¶ added in v0.3.1
DecodeUintSlice decodes an unsigned integer slice from an unknown value
func EncodeMap
deprecated
func EncodeMap[T MapEncoder](input T) map[string]any
EncodeMap encodes an object to a map[string]any, using json tag to convert object keys
Deprecated: use EncodeObject instead
func EncodeMaps
deprecated
func EncodeMaps[T MapEncoder](inputs []T) []map[string]any
EncodeMaps encode objects to a slice of map[string]any, using json tag to convert object keys
Deprecated: use EncodeObjectSlice instead
func EncodeNullableMaps
deprecated
func EncodeNullableMaps[T MapEncoder](inputs *[]T) []map[string]any
EncodeNullableMaps encode objects to a slice of map[string]any, using json tag to convert object keys
Deprecated: use EncodeNullableObjectSlice instead
func EncodeNullableObjectSlice ¶ added in v0.3.1
EncodeNullableObjectSlice encodes the pointer array of unknown type to map[string]any slice, using json tag to convert object keys
func EncodeObject ¶
EncodeObject encodes an unknown type to a map[string]any, using json tag to convert object keys
func EncodeObjectSlice ¶
EncodeObjectSlice encodes an array of unknown type to map[string]any slice, using json tag to convert object keys
func EncodeObjectWithColumnSelection ¶
func EncodeObjectWithColumnSelection[T any](fields map[string]schema.Field, data T) (map[string]any, error)
EncodeObjectWithColumnSelection encodes an object with column fields selection without relationship
func EncodeObjects ¶
EncodeObjects encodes an object rows to a slice of map[string]any, using json tag to convert object keys
func EncodeObjectsWithColumnSelection ¶
func EncodeObjectsWithColumnSelection[T any](fields map[string]schema.Field, data []T) ([]map[string]any, error)
EncodeObjectsWithColumnSelection encodes objects with column fields selection without relationship
func EvalFunctionSelectionFieldValue ¶ added in v0.1.3
func EvalFunctionSelectionFieldValue(request *schema.QueryRequest) (schema.NestedField, error)
EvalFunctionSelectionFieldValue evaluates the __value field in a function query According to the NDC spec, selection fields of the function type must follow this structure:
{ "fields": { "__value": { "type": "column", "column": "__value", "fields": { "type": "object", "fields": { "fieldA": { "type": "column", "column": "fieldA", "fields": null } } // or null } } } }
func EvalNestedColumnArray ¶
func EvalNestedColumnArray(fields *schema.NestedArray, value any) (any, error)
EvalNestedColumnArray evaluate and prune nested fields from array without relationship
func EvalNestedColumnArrayIntoSlice ¶
func EvalNestedColumnArrayIntoSlice[T any](fields *schema.NestedArray, value []T) (any, error)
EvalNestedColumnArrayIntoSlice evaluate and prune nested fields from array without relationship
func EvalNestedColumnFields ¶
func EvalNestedColumnFields(fields schema.NestedField, value any) (any, error)
EvalNestedColumnFields evaluate and prune nested fields without relationship
func EvalNestedColumnObject ¶
func EvalNestedColumnObject(fields *schema.NestedObject, value any) (any, error)
EvalNestedColumnObject evaluate and prune nested fields from an object without relationship
func EvalObjectWithColumnSelection ¶
func EvalObjectWithColumnSelection(fields map[string]schema.Field, data map[string]any) (map[string]any, error)
EvalObjectWithColumnSelection evaluate and prune column fields without relationship
func EvalObjectsWithColumnSelection ¶
func EvalObjectsWithColumnSelection(fields map[string]schema.Field, data []map[string]any) ([]map[string]any, error)
EvalObjectsWithColumnSelection evaluate and prune column fields of array objects without relationship
func GetArbitraryJSON ¶ added in v0.3.1
GetArbitraryJSON get an arbitrary json value from object by key
func GetArbitraryJSONPtrSlice ¶ added in v0.3.1
GetArbitraryJSONPtrSlice get an arbitrary json pointer slice from object by key
func GetArbitraryJSONSlice ¶ added in v0.3.1
GetArbitraryJSON get an arbitrary json slice from object by key
func GetBoolean ¶ added in v0.3.1
GetBoolean get a bool value from object by key
func GetBooleanPtrSlice ¶ added in v0.3.1
GetBooleanPtrSlice get a boolean pointer slice value from object by key
func GetBooleanSlice ¶ added in v0.3.1
GetBooleanSlice get a boolean slice value from object by key
func GetDateTime ¶
GetDateTime get a time.Time value from object by key
func GetDateTimePtrSlice ¶ added in v0.3.1
GetDateTimePtrSlice get a time.Time pointer slice from object by key
func GetDateTimeSlice ¶ added in v0.3.1
GetDateTimeSlice get a time.Time slice from object by key
func GetDefault ¶ added in v0.3.0
func GetDefault[T comparable](value T, defaultValue T) T
GetDefault returns the value or default one if value is empty
func GetDefaultPtr ¶ added in v0.3.0
func GetDefaultPtr[T any](value *T, defaultValue *T) *T
GetDefaultPtr returns the first pointer or default one if GetDefaultPtr is nil
func GetDefaultValuePtr ¶ added in v0.3.0
func GetDefaultValuePtr[T comparable](value *T, defaultValue T) T
GetDefaultValuePtr return the value of pointer or default one if the value of pointer is null or empty
func GetDuration ¶
GetDuration get a time.Duration value from object by key
func GetFloatPtrSlice ¶ added in v0.3.1
GetFloatPtrSlice get a float slice from object by key
func GetFloatSlice ¶ added in v0.3.1
GetFloatSlice get a float slice from object by key
func GetIntPtrSlice ¶ added in v0.3.1
func GetIntPtrSlice[T int | int8 | int16 | int32 | int64](object map[string]any, key string) ([]*T, error)
GetIntPtrSlice get an integer slice from object by key
func GetIntSlice ¶ added in v0.3.1
func GetIntSlice[T int | int8 | int16 | int32 | int64](object map[string]any, key string) ([]T, error)
GetIntSlice get an integer slice from object by key
func GetNullableArbitraryJSON ¶ added in v0.3.1
GetNullableArbitraryJSON get an arbitrary json pointer from object by key
func GetNullableArbitraryJSONPtrSlice ¶ added in v0.3.1
GetNullableArbitraryJSONPtrSlice get a nullable arbitrary json pointer slice from object by key
func GetNullableArbitraryJSONSlice ¶ added in v0.3.1
GetNullableArbitraryJSONSlice get a nullable arbitrary json slice from object by key
func GetNullableBoolean ¶ added in v0.3.1
GetNullableBoolean get a bool pointer from object by key
func GetNullableBooleanPtrSlice ¶ added in v0.3.1
GetNullableBooleanPtrSlice get a nullable boolean slice from object by key
func GetNullableBooleanSlice ¶ added in v0.3.1
GetNullableBooleanSlice get a nullable boolean slice from object by key
func GetNullableDateTime ¶
GetNullableDateTime get a time.Time pointer from object by key
func GetNullableDateTimePtrSlice ¶ added in v0.3.1
GetNullableDateTimePtrSlice get a nullable time.Time pointer slice from object by key
func GetNullableDateTimeSlice ¶ added in v0.3.1
GetNullableDateTimeSlice get a nullable time.Time slice from object by key
func GetNullableDuration ¶
GetNullableDuration get a time.Duration pointer from object by key
func GetNullableFloat ¶
GetNullableFloat get a float pointer from object by key
func GetNullableFloatPtrSlice ¶ added in v0.3.1
func GetNullableFloatPtrSlice[T float32 | float64](object map[string]any, key string) (*[]*T, error)
GetNullableFloatPtrSlice get a float pointer slice from object by key
func GetNullableFloatSlice ¶ added in v0.3.1
GetNullableFloatSlice get a float pointer slice from object by key
func GetNullableInt ¶
func GetNullableInt[T int | int8 | int16 | int32 | int64](object map[string]any, key string) (*T, error)
GetNullableInt get an integer pointer from object by key
func GetNullableIntPtrSlice ¶ added in v0.3.1
func GetNullableIntPtrSlice[T int | int8 | int16 | int32 | int64](object map[string]any, key string) (*[]*T, error)
GetNullableIntPtrSlice get an integer pointer slice from object by key
func GetNullableIntSlice ¶ added in v0.3.1
func GetNullableIntSlice[T int | int8 | int16 | int32 | int64](object map[string]any, key string) (*[]T, error)
GetNullableIntSlice get an integer pointer slice from object by key
func GetNullableRawJSON ¶ added in v0.3.1
GetNullableRawJSON gets a raw json.RawMessage pointer from object by key
func GetNullableRawJSONPtrSlice ¶ added in v0.3.1
GetNullableRawJSONPtrSlice get a nullable json.RawMessage pointer slice from object by key
func GetNullableRawJSONSlice ¶ added in v0.3.1
GetNullableRawJSONSlice get a nullable json.RawMessage slice from object by key
func GetNullableString ¶
GetNullableString get a string pointer from object by key
func GetNullableStringPtrSlice ¶ added in v0.3.1
GetNullableStringPtrSlice get a nullable string pointer slice from object by key
func GetNullableStringSlice ¶ added in v0.3.1
GetNullableStringSlice get a string pointer slice from object by key
func GetNullableUUID ¶ added in v0.3.1
GetNullableUUID get an UUID pointer from object by key
func GetNullableUUIDPtrSlice ¶ added in v0.3.1
GetNullableUUIDPtrSlice get an UUID pointer slice from object by key
func GetNullableUUIDSlice ¶ added in v0.3.1
GetNullableUUIDSlice get an UUID pointer slice from object by key
func GetNullableUint ¶
func GetNullableUint[T uint | uint8 | uint16 | uint32 | uint64](object map[string]any, key string) (*T, error)
GetNullableUint get an unsigned integer pointer from object by key
func GetNullableUintPtrSlice ¶ added in v0.3.1
func GetNullableUintPtrSlice[T uint | uint8 | uint16 | uint32 | uint64](object map[string]any, key string) (*[]*T, error)
GetNullableUintPtrSlice get an unsigned integer pointer slice from object by key
func GetNullableUintSlice ¶ added in v0.3.1
func GetNullableUintSlice[T uint | uint8 | uint16 | uint32 | uint64](object map[string]any, key string) (*[]T, error)
GetNullableUintSlice get an unsigned integer pointer slice from object by key
func GetRawJSON ¶ added in v0.3.1
GetRawJSON get a raw json.RawMessage value from object by key
func GetRawJSONPtrSlice ¶ added in v0.3.1
GetRawJSONPtrSlice get a json.RawMessage pointer slice from object by key
func GetRawJSONSlice ¶ added in v0.3.1
GetRawJSONSlice get a raw json.RawMessage slice from object by key
func GetStringPtrSlice ¶ added in v0.3.1
GetStringPtrSlice get a string pointer slice value from object by key
func GetStringSlice ¶ added in v0.3.1
GetStringSlice get a string slice value from object by key
func GetUUIDPtrSlice ¶ added in v0.3.1
GetUUIDPtrSlice get an UUID slice from object by key
func GetUUIDSlice ¶ added in v0.3.1
GetUUIDSlice get an UUID slice from object by key
func GetUint ¶
func GetUint[T uint | uint8 | uint16 | uint32 | uint64](object map[string]any, key string) (T, error)
GetUint get an unsigned integer value from object by key
func GetUintPtrSlice ¶ added in v0.3.1
func GetUintPtrSlice[T uint | uint8 | uint16 | uint32 | uint64](object map[string]any, key string) ([]*T, error)
GetUintPtrSlice get an unsigned integer slice from object by key
func GetUintSlice ¶ added in v0.3.1
func GetUintSlice[T uint | uint8 | uint16 | uint32 | uint64](object map[string]any, key string) ([]T, error)
GetUintSlice get an unsigned integer slice from object by key
func JSONAttribute ¶ added in v0.3.0
JSONAttribute creates a OpenTelemetry attribute with JSON data
func PointersToValues ¶ added in v0.3.1
PointersToValues converts the pointer slice to value slice
func ResolveArgumentVariables ¶
func ResolveArgumentVariables(arguments map[string]schema.Argument, variables map[string]any) (map[string]any, error)
ResolveArgumentVariables resolve variables in arguments if exist
func ToPtrs ¶ added in v0.3.1
func ToPtrs[T any](input []T) []*T
ToPtrs converts the value slice to pointer slice
func UnwrapPointerFromAny ¶ added in v0.3.1
UnwrapPointerFromAny unwraps pointers from the input any type
Types ¶
type Decoder ¶ added in v0.1.1
type Decoder struct {
// contains filtered or unexported fields
}
Decoder is a wrapper of mapstructure decoder
func NewDecoder ¶ added in v0.1.1
func NewDecoder(decodeHooks ...mapstructure.DecodeHookFunc) *Decoder
NewDecoder creates a Decoder instance
func (Decoder) DecodeNullableObjectValue ¶ added in v0.1.1
DecodeNullableObjectValue get and decode a nullable value from object by key
func (Decoder) DecodeNullableValue ¶ added in v0.1.1
DecodeNullableValue tries to convert and set an unknown value into the target, fallback to mapstructure decoder
func (Decoder) DecodeObjectValue ¶ added in v0.1.1
DecodeObjectValue get and decode a value from object by key
type MapEncoder ¶
MapEncoder abstracts a type with the ToMap method to encode type to map
type ObjectDecoder ¶
ObjectDecoder abstracts a type with the FromValue method to decode an object value
type Scalar ¶
type Scalar interface {
ScalarName() string
}
Scalar abstracts a scalar interface to determine when evaluating
type ValueDecoder ¶
ValueDecoder abstracts a type with the FromValue method to decode any value