Documentation
¶
Index ¶
- Constants
- Variables
- func CommandSelectionFieldFromContext(ctx context.Context) schema.NestedField
- 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 DecodeBooleanReflection(value reflect.Value) (bool, error)
- func DecodeBooleanSlice(value any) ([]bool, error)
- func DecodeDate(value any, options ...DecodeTimeOption) (time.Time, error)
- func DecodeDateReflection(value reflect.Value, options ...DecodeTimeOption) (time.Time, error)
- func DecodeDateTime(value any, options ...DecodeTimeOption) (time.Time, error)
- func DecodeDateTimePtrSlice(value any) ([]*time.Time, error)
- func DecodeDateTimeReflection(value reflect.Value, options ...DecodeTimeOption) (time.Time, error)
- func DecodeDateTimeSlice(value any) ([]time.Time, error)
- func DecodeDuration(value any, options ...DecodeTimeOption) (time.Duration, error)
- func DecodeFloat[T float32 | float64](value any) (T, error)
- func DecodeFloatPtrSlice[T float32 | float64](value any) ([]*T, error)
- func DecodeFloatReflection[T float32 | float64](value reflect.Value) (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 DecodeIntReflection[T int | int8 | int16 | int32 | int64](value reflect.Value) (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 DecodeNullableBooleanReflection(value reflect.Value) (*bool, error)
- func DecodeNullableBooleanSlice(value any) (*[]bool, error)
- func DecodeNullableDate(value any, options ...DecodeTimeOption) (*time.Time, error)
- func DecodeNullableDateReflection(value reflect.Value, options ...DecodeTimeOption) (*time.Time, error)
- func DecodeNullableDateTime(value any, options ...DecodeTimeOption) (*time.Time, error)
- func DecodeNullableDateTimePtrSlice(value any) (*[]*time.Time, error)
- func DecodeNullableDateTimeReflection(value reflect.Value, options ...DecodeTimeOption) (*time.Time, error)
- func DecodeNullableDateTimeSlice(value any) (*[]time.Time, error)
- func DecodeNullableDuration(value any, options ...DecodeTimeOption) (*time.Duration, error)
- func DecodeNullableDurationReflection(value reflect.Value, options ...DecodeTimeOption) (*time.Duration, error)
- func DecodeNullableFloat[T float32 | float64](value any) (*T, error)
- func DecodeNullableFloatPtrSlice[T float32 | float64](value any) (*[]*T, error)
- func DecodeNullableFloatReflection[T float32 | float64](value reflect.Value) (*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 DecodeNullableIntReflection[T int | int8 | int16 | int32 | int64](value reflect.Value) (*T, error)
- func DecodeNullableIntSlice[T int | int8 | int16 | int32 | int64](value any) (*[]T, error)
- func DecodeNullableObject[T any](value map[string]any, decodeHooks ...mapstructure.DecodeHookFunc) (*T, error)
- func DecodeNullableObjectValue[T any](object map[string]any, key string, decodeHooks ...mapstructure.DecodeHookFunc) (*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 DecodeNullableStringReflection(value reflect.Value) (*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 DecodeNullableUintReflection[T uint | uint8 | uint16 | uint32 | uint64](value reflect.Value) (*T, error)
- func DecodeNullableUintSlice[T uint | uint8 | uint16 | uint32 | uint64](value any) (*[]T, error)
- func DecodeNullableValue[T any](value any, decodeHooks ...mapstructure.DecodeHookFunc) (*T, error)
- func DecodeObject[T any](value map[string]any, decodeHooks ...mapstructure.DecodeHookFunc) (T, error)
- func DecodeObjectValue[T any](object map[string]any, key string, decodeHooks ...mapstructure.DecodeHookFunc) (T, error)
- func DecodeObjectValueDefault[T any](object map[string]any, key string, decodeHooks ...mapstructure.DecodeHookFunc) (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 DecodeStringReflection(value reflect.Value) (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 DecodeUintReflection[T uint | uint8 | uint16 | uint32 | uint64](value reflect.Value) (T, error)
- func DecodeUintSlice[T uint | uint8 | uint16 | uint32 | uint64](value any) ([]T, error)
- func DecodeValue[T any](value any, decodeHooks ...mapstructure.DecodeHookFunc) (T, error)
- 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 GetArbitraryJSONDefault(object map[string]any, key string) (any, error)
- func GetArbitraryJSONPtrSlice(object map[string]any, key string) ([]*any, error)
- func GetArbitraryJSONPtrSliceDefault(object map[string]any, key string) ([]*any, error)
- func GetArbitraryJSONSlice(object map[string]any, key string) ([]any, error)
- func GetArbitraryJSONSliceDefault(object map[string]any, key string) ([]any, error)
- func GetBoolean(object map[string]any, key string) (bool, error)
- func GetBooleanDefault(object map[string]any, key string) (bool, error)
- func GetBooleanPtrSlice(object map[string]any, key string) ([]*bool, error)
- func GetBooleanPtrSliceDefault(object map[string]any, key string) ([]*bool, error)
- func GetBooleanSlice(object map[string]any, key string) ([]bool, error)
- func GetBooleanSliceDefault(object map[string]any, key string) ([]bool, error)
- func GetDateTime(object map[string]any, key string, options ...DecodeTimeOption) (time.Time, error)
- func GetDateTimeDefault(object map[string]any, key string, options ...DecodeTimeOption) (time.Time, error)
- func GetDateTimePtrSlice(object map[string]any, key string) ([]*time.Time, error)
- func GetDateTimePtrSliceDefault(object map[string]any, key string) ([]*time.Time, error)
- func GetDateTimeSlice(object map[string]any, key string) ([]time.Time, error)
- func GetDateTimeSliceDefault(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, options ...DecodeTimeOption) (time.Duration, error)
- func GetDurationDefault(object map[string]any, key string, options ...DecodeTimeOption) (time.Duration, error)
- func GetFloat[T float32 | float64](object map[string]any, key string) (T, error)
- func GetFloatDefault[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 GetFloatPtrSliceDefault[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 GetFloatSliceDefault[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 GetIntDefault[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 GetIntPtrSliceDefault[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 GetIntSliceDefault[T int | int8 | int16 | int32 | int64](object map[string]any, key string) ([]T, error)
- func GetKeys[K cmp.Ordered, V any](input map[K]V) []K
- 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, options ...DecodeTimeOption) (*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, options ...DecodeTimeOption) (*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 GetRawJSONDefault(object map[string]any, key string) (json.RawMessage, error)
- func GetRawJSONPtrSlice(object map[string]any, key string) ([]*json.RawMessage, error)
- func GetRawJSONPtrSliceDefault(object map[string]any, key string) ([]*json.RawMessage, error)
- func GetRawJSONSlice(object map[string]any, key string) ([]json.RawMessage, error)
- func GetRawJSONSliceDefault(object map[string]any, key string) ([]json.RawMessage, error)
- func GetSortedKeys[K cmp.Ordered, V any](input map[K]V) []K
- func GetSortedValuesByKey[K cmp.Ordered, V any](input map[K]V) []V
- func GetString(object map[string]any, key string) (string, error)
- func GetStringDefault(object map[string]any, key string) (string, error)
- func GetStringPtrSlice(object map[string]any, key string) ([]*string, error)
- func GetStringPtrSliceDefault(object map[string]any, key string) ([]*string, error)
- func GetStringSlice(object map[string]any, key string) ([]string, error)
- func GetStringSliceDefault(object map[string]any, key string) ([]string, error)
- func GetUUID(object map[string]any, key string) (uuid.UUID, error)
- func GetUUIDDefault(object map[string]any, key string) (uuid.UUID, error)
- func GetUUIDPtrSlice(object map[string]any, key string) ([]*uuid.UUID, error)
- func GetUUIDPtrSliceDefault(object map[string]any, key string) ([]*uuid.UUID, error)
- func GetUUIDSlice(object map[string]any, key string) ([]uuid.UUID, error)
- func GetUUIDSliceDefault(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 GetUintDefault[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 GetUintPtrSliceDefault[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 GetUintSliceDefault[T uint | uint8 | uint16 | uint32 | uint64](object map[string]any, key string) ([]T, error)
- func IsDebug(logger *slog.Logger) bool
- func IsNil(value any) bool
- func JSONAttribute(key string, data any) attribute.KeyValue
- func MergeMap[K comparable, V any](dest map[K]V, src map[K]V) map[K]V
- func MergeSchemas(schemas ...*schema.SchemaResponse) (*schema.SchemaResponse, []error)
- func ParseBoolMapFromString(input string) (map[string]bool, error)
- func ParseFloatMapFromString[T float32 | float64](input string) (map[string]T, error)
- func ParseIntMapFromString(input string) (map[string]int, error)
- func ParseIntegerMapFromString[T int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64](input string) (map[string]T, error)
- func ParseStringMapFromString(input string) (map[string]string, error)
- func PointersToValues[T any](input []*T) ([]T, error)
- func ResolveArgument(argument schema.Argument, variables map[string]any) (any, error)
- func ResolveArgumentVariables(arguments map[string]schema.Argument, variables map[string]any) (map[string]any, error)
- func ResolveArguments(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 UnwrapPointerFromAnyToReflectValue(value any) (reflect.Value, bool)
- func UnwrapPointerFromReflectValue(reflectValue reflect.Value) (reflect.Value, bool)
- type DecodeTimeOption
- type EnvBool
- type EnvFloat
- type EnvInt
- type EnvMapBool
- type EnvMapFloat
- type EnvMapInt
- type EnvMapString
- type EnvString
- type MapEncoder
- type ObjectDecoder
- type Scalar
- type ValueDecoder
Constants ¶
const ( // CommandSelectionFieldKey the context key for the nested selection field in command. CommandSelectionFieldKey string = "ndc-command-selection-field" )
Variables ¶
var ErrHandlerNotfound = errors.New("connector handler not found")
Functions ¶
func CommandSelectionFieldFromContext ¶
func CommandSelectionFieldFromContext(ctx context.Context) schema.NestedField
CommandSelectionFieldFromContext gets the command's nested selection field from context.
func DebugJSONAttributes ¶
DebugJSONAttributes create OpenTelemetry attributes with JSON data. They are only visible on debug mode.
func DecodeArbitraryJSONPtrSlice ¶
DecodeArbitraryJSONPtrSlice decodes an arbitrary json pointer slice from object by key.
func DecodeArbitraryJSONSlice ¶
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 ¶
DecodeBooleanPtrSlice decodes a boolean pointer slice from an unknown value.
func DecodeBooleanReflection ¶
DecodeBooleanReflection decodes a boolean value from reflection.
func DecodeBooleanSlice ¶
DecodeBooleanSlice decodes a boolean slice from an unknown value.
func DecodeDate ¶
func DecodeDate(value any, options ...DecodeTimeOption) (time.Time, error)
DecodeDate tries to convert an unknown date value to a time.Time value.
func DecodeDateReflection ¶
DecodeDateReflection decodes a date value from reflection.
func DecodeDateTime ¶
func DecodeDateTime(value any, options ...DecodeTimeOption) (time.Time, error)
DecodeDateTime tries to convert an unknown value to a time.Time value.
func DecodeDateTimePtrSlice ¶
DecodeDateTimePtrSlice tries to convert an unknown value to a time.Time pointer slice.
func DecodeDateTimeReflection ¶
DecodeDateTimeReflection decodes a time.Time value from reflection.
func DecodeDateTimeSlice ¶
DecodeDateTimeSlice tries to convert an unknown value to a time.Time slice.
func DecodeDuration ¶
func DecodeDuration(value any, options ...DecodeTimeOption) (time.Duration, error)
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 ¶
DecodeFloatPtrSlice decodes a float pointer slice from an unknown value.
func DecodeFloatReflection ¶
DecodeFloatReflection decodes the floating-point value using reflection.
func DecodeFloatSlice ¶
DecodeFloatSlice decodes a float slice from an unknown value.
func DecodeIntPtrSlice ¶
DecodeIntPtrSlice decodes an integer slice from an unknown value.
func DecodeIntReflection ¶
DecodeIntReflection tries to convert an reflection value to an integer.
func DecodeIntSlice ¶
DecodeIntSlice decodes an integer slice from an unknown value.
func DecodeNullableArbitraryJSONPtrSlice ¶
DecodeNullableArbitraryJSONPtrSlice decodes a nullable arbitrary json pointer slice from object by key.
func DecodeNullableArbitraryJSONSlice ¶
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 ¶
DecodeNullableBooleanPtrSlice decodes a boolean pointer slice from an unknown value.
func DecodeNullableBooleanReflection ¶
DecodeNullableBooleanReflection decodes a nullable boolean value from reflection.
func DecodeNullableBooleanSlice ¶
DecodeNullableBooleanSlice decodes a nullable boolean slice from an unknown value.
func DecodeNullableDate ¶
func DecodeNullableDate(value any, options ...DecodeTimeOption) (*time.Time, error)
DecodeNullableDate tries to convert an unknown value to a date pointer.
func DecodeNullableDateReflection ¶
func DecodeNullableDateReflection( value reflect.Value, options ...DecodeTimeOption, ) (*time.Time, error)
DecodeNullableDateReflection decodes a nullable date value from reflection.
func DecodeNullableDateTime ¶
func DecodeNullableDateTime(value any, options ...DecodeTimeOption) (*time.Time, error)
DecodeNullableDateTime tries to convert an unknown value to a time.Time pointer.
func DecodeNullableDateTimePtrSlice ¶
DecodeNullableDateTimePtrSlice tries to convert an unknown value to a nullable time.Time pointer slice.
func DecodeNullableDateTimeReflection ¶
func DecodeNullableDateTimeReflection( value reflect.Value, options ...DecodeTimeOption, ) (*time.Time, error)
DecodeNullableDateTimeReflection decodes a nullable time.Time value from reflection.
func DecodeNullableDateTimeSlice ¶
DecodeNullableDateTimeSlice tries to convert an unknown value to a nullable time.Time slice.
func DecodeNullableDuration ¶
func DecodeNullableDuration(value any, options ...DecodeTimeOption) (*time.Duration, error)
DecodeNullableDuration tries to convert an unknown value to a duration pointer.
func DecodeNullableDurationReflection ¶
func DecodeNullableDurationReflection( value reflect.Value, options ...DecodeTimeOption, ) (*time.Duration, error)
DecodeNullableDurationReflection tries to convert an unknown value to a duration pointer via reflection.
func DecodeNullableFloat ¶
DecodeNullableFloat tries to convert an unknown value to a float pointer.
func DecodeNullableFloatPtrSlice ¶
DecodeNullableFloatPtrSlice decodes a float pointer slice from an unknown value.
func DecodeNullableFloatReflection ¶
DecodeNullableFloatReflection decodes the nullable floating-point value using reflection.
func DecodeNullableFloatSlice ¶
DecodeNullableFloatSlice decodes a float slice from an unknown value.
func DecodeNullableInt ¶
DecodeNullableInt tries to convert an unknown value to a nullable integer.
func DecodeNullableIntPtrSlice ¶
DecodeNullableIntPtrSlice decodes an integer pointer slice from an unknown value.
func DecodeNullableIntReflection ¶
func DecodeNullableIntReflection[T int | int8 | int16 | int32 | int64]( value reflect.Value, ) (*T, error)
DecodeNullableIntReflection tries to convert an reflection value to a nullable integer.
func DecodeNullableIntSlice ¶
DecodeNullableIntSlice decodes an integer pointer slice from an unknown value.
func DecodeNullableObject ¶
func DecodeNullableObject[T any]( value map[string]any, decodeHooks ...mapstructure.DecodeHookFunc, ) (*T, error)
DecodeNullableObject tries to decode an object from a map.
func DecodeNullableObjectValue ¶
func DecodeNullableObjectValue[T any]( object map[string]any, key string, decodeHooks ...mapstructure.DecodeHookFunc, ) (*T, error)
DecodeNullableObjectValue get and decode a nullable value from object by key.
func DecodeNullableRawJSON ¶
func DecodeNullableRawJSON(value any) (*json.RawMessage, error)
DecodeNullableRawJSON decodes a raw json.RawMessage pointer from object by key.
func DecodeNullableRawJSONPtrSlice ¶
func DecodeNullableRawJSONPtrSlice(value any) (*[]*json.RawMessage, error)
DecodeNullableRawJSONPtrSlice decodes a nullable json.RawMessage pointer slice from object by key.
func DecodeNullableRawJSONSlice ¶
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 ¶
DecodeNullableStringPtrSlice decodes a nullable string slice from an unknown value.
func DecodeNullableStringReflection ¶
DecodeNullableStringReflection a nullable string from reflection value.
func DecodeNullableStringSlice ¶
DecodeNullableStringSlice decodes a nullable string slice from an unknown value.
func DecodeNullableUUID ¶
DecodeNullableUUID decodes UUID pointer from string or bytes.
func DecodeNullableUUIDPtrSlice ¶
DecodeNullableUUIDPtrSlice decodes UUID pointer slice from array string.
func DecodeNullableUUIDSlice ¶
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 ¶
func DecodeNullableUintPtrSlice[T uint | uint8 | uint16 | uint32 | uint64]( value any, ) (*[]*T, error)
DecodeNullableUintPtrSlice decodes an unsigned integer pointer slice from an unknown value.
func DecodeNullableUintReflection ¶
func DecodeNullableUintReflection[T uint | uint8 | uint16 | uint32 | uint64]( value reflect.Value, ) (*T, error)
DecodeNullableUintReflection tries to convert an reflection value to a nullable unsigned-integer.
func DecodeNullableUintSlice ¶
DecodeNullableUintSlice decodes an unsigned integer slice from an unknown value.
func DecodeNullableValue ¶
func DecodeNullableValue[T any](value any, decodeHooks ...mapstructure.DecodeHookFunc) (*T, error)
DecodeNullableValue tries to convert and set an unknown value into the target, fallback to mapstructure decoder.
func DecodeObject ¶
func DecodeObject[T any]( value map[string]any, decodeHooks ...mapstructure.DecodeHookFunc, ) (T, error)
DecodeObject tries to decode an object from a map.
func DecodeObjectValue ¶
func DecodeObjectValue[T any]( object map[string]any, key string, decodeHooks ...mapstructure.DecodeHookFunc, ) (T, error)
DecodeObjectValue get and decode a value from object by key.
func DecodeObjectValueDefault ¶
func DecodeObjectValueDefault[T any]( object map[string]any, key string, decodeHooks ...mapstructure.DecodeHookFunc, ) (T, error)
DecodeObjectValueDefault get and decode a value from object by key. Returns the empty object if the input value is null.
func DecodeRawJSONPtrSlice ¶
func DecodeRawJSONPtrSlice(value any) ([]*json.RawMessage, error)
DecodeRawJSONPtrSlice decodes a json.RawMessage pointer slice from object by key.
func DecodeRawJSONSlice ¶
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 ¶
DecodeStringPtrSlice decodes a string pointer slice from an unknown value.
func DecodeStringReflection ¶
DecodeStringReflection decodes a string from reflection value.
func DecodeStringSlice ¶
DecodeStringSlice decodes a string slice from an unknown value.
func DecodeUUID ¶
DecodeUUID decodes UUID from string.
func DecodeUUIDPtrSlice ¶
DecodeUUIDPtrSlice decodes UUID slice from array string.
func DecodeUUIDSlice ¶
DecodeUUIDSlice decodes UUID slice from array string.
func DecodeUint ¶
DecodeUint tries to convert an unknown value to an unsigned integer value.
func DecodeUintPtrSlice ¶
DecodeUintPtrSlice decodes an unsigned integer pointer slice from an unknown value.
func DecodeUintReflection ¶
func DecodeUintReflection[T uint | uint8 | uint16 | uint32 | uint64]( value reflect.Value, ) (T, error)
DecodeUintReflection tries to convert an reflection value to an unsigned-integer.
func DecodeUintSlice ¶
DecodeUintSlice decodes an unsigned integer slice from an unknown value.
func DecodeValue ¶
func DecodeValue[T any](value any, decodeHooks ...mapstructure.DecodeHookFunc) (T, error)
DecodeValue tries to convert and set an unknown value into the target, the value must not be null fallback to mapstructure decoder.
func EncodeNullableObjectSlice ¶
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 ¶
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 ¶
GetArbitraryJSON get an arbitrary json value from object by key.
func GetArbitraryJSONDefault ¶
GetArbitraryJSONDefault returns nil if the value does not exist.
func GetArbitraryJSONPtrSlice ¶
GetArbitraryJSONPtrSlice get an arbitrary json pointer slice from object by key.
func GetArbitraryJSONPtrSliceDefault ¶
GetArbitraryJSONPtrSliceDefault get an arbitrary json pointer slice from object by key.
func GetArbitraryJSONSlice ¶
GetArbitraryJSONSlice get an arbitrary json slice from object by key.
func GetArbitraryJSONSliceDefault ¶
GetArbitraryJSONSliceDefault get an arbitrary json slice from object by key.
func GetBoolean ¶
GetBoolean get a bool value from object by key.
func GetBooleanDefault ¶
GetBooleanDefault returns false if the value is null.
func GetBooleanPtrSlice ¶
GetBooleanPtrSlice get a boolean pointer slice value from object by key.
func GetBooleanPtrSliceDefault ¶
GetBooleanPtrSliceDefault get a boolean pointer slice value from object by key.
func GetBooleanSlice ¶
GetBooleanSlice get a boolean slice value from object by key.
func GetBooleanSliceDefault ¶
GetBooleanSliceDefault get a boolean slice value from object by key.
func GetDateTime ¶
func GetDateTime( object map[string]any, key string, options ...DecodeTimeOption, ) (time.Time, error)
GetDateTime get a time.Time value from object by key.
func GetDateTimeDefault ¶
func GetDateTimeDefault( object map[string]any, key string, options ...DecodeTimeOption, ) (time.Time, error)
GetDateTimeDefault get a time.Time value from object by key. Returns the empty time if the value is empty.
func GetDateTimePtrSlice ¶
GetDateTimePtrSlice get a time.Time pointer slice from object by key.
func GetDateTimePtrSliceDefault ¶
GetDateTimePtrSliceDefault get a time.Time pointer slice from object by key.
func GetDateTimeSlice ¶
GetDateTimeSlice get a time.Time slice from object by key.
func GetDateTimeSliceDefault ¶
GetDateTimeSliceDefault get a time.Time slice from object by key.
func GetDefault ¶
func GetDefault[T comparable](value T, defaultValue T) T
GetDefault returns the value or default one if value is empty.
func GetDefaultPtr ¶
func GetDefaultPtr[T any](value *T, defaultValue *T) *T
GetDefaultPtr returns the first pointer or default one if GetDefaultPtr is nil.
func GetDefaultValuePtr ¶
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 ¶
func GetDuration( object map[string]any, key string, options ...DecodeTimeOption, ) (time.Duration, error)
GetDuration get a time.Duration value from object by key.
func GetDurationDefault ¶
func GetDurationDefault( object map[string]any, key string, options ...DecodeTimeOption, ) (time.Duration, error)
GetDurationDefault get a time.Duration value from object by key. Returns 0 if the value is null.
func GetFloatDefault ¶
GetFloatDefault get a float value from object by key. Returns 0 if the field is null.
func GetFloatPtrSlice ¶
GetFloatPtrSlice get a float slice from object by key.
func GetFloatPtrSliceDefault ¶
GetFloatPtrSliceDefault get a float slice from object by key.
func GetFloatSlice ¶
GetFloatSlice get a float slice from object by key.
func GetFloatSliceDefault ¶
GetFloatSliceDefault get a float slice from object by key.
func GetIntDefault ¶
func GetIntDefault[T int | int8 | int16 | int32 | int64]( object map[string]any, key string, ) (T, error)
GetIntDefault get an integer value from object by key. Returns 0 if the field is null.
func GetIntPtrSlice ¶
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 GetIntPtrSliceDefault ¶
func GetIntPtrSliceDefault[T int | int8 | int16 | int32 | int64]( object map[string]any, key string, ) ([]*T, error)
GetIntPtrSliceDefault get an integer slice from object by key.
func GetIntSlice ¶
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 GetIntSliceDefault ¶
func GetIntSliceDefault[T int | int8 | int16 | int32 | int64]( object map[string]any, key string, ) ([]T, error)
GetIntSliceDefault get an integer slice from object by key.
func GetNullableArbitraryJSON ¶
GetNullableArbitraryJSON get an arbitrary json pointer from object by key.
func GetNullableArbitraryJSONPtrSlice ¶
GetNullableArbitraryJSONPtrSlice get a nullable arbitrary json pointer slice from object by key.
func GetNullableArbitraryJSONSlice ¶
GetNullableArbitraryJSONSlice get a nullable arbitrary json slice from object by key.
func GetNullableBoolean ¶
GetNullableBoolean get a bool pointer from object by key.
func GetNullableBooleanPtrSlice ¶
GetNullableBooleanPtrSlice get a nullable boolean slice from object by key.
func GetNullableBooleanSlice ¶
GetNullableBooleanSlice get a nullable boolean slice from object by key.
func GetNullableDateTime ¶
func GetNullableDateTime( object map[string]any, key string, options ...DecodeTimeOption, ) (*time.Time, error)
GetNullableDateTime get a time.Time pointer from object by key.
func GetNullableDateTimePtrSlice ¶
GetNullableDateTimePtrSlice get a nullable time.Time pointer slice from object by key.
func GetNullableDateTimeSlice ¶
GetNullableDateTimeSlice get a nullable time.Time slice from object by key.
func GetNullableDuration ¶
func GetNullableDuration( object map[string]any, key string, options ...DecodeTimeOption, ) (*time.Duration, error)
GetNullableDuration get a time.Duration pointer from object by key.
func GetNullableFloat ¶
GetNullableFloat get a float pointer from object by key.
func GetNullableFloatPtrSlice ¶
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 ¶
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 ¶
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 ¶
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 ¶
GetNullableRawJSON gets a raw json.RawMessage pointer from object by key.
func GetNullableRawJSONPtrSlice ¶
GetNullableRawJSONPtrSlice get a nullable json.RawMessage pointer slice from object by key.
func GetNullableRawJSONSlice ¶
GetNullableRawJSONSlice get a nullable json.RawMessage slice from object by key.
func GetNullableString ¶
GetNullableString get a string pointer from object by key.
func GetNullableStringPtrSlice ¶
GetNullableStringPtrSlice get a nullable string pointer slice from object by key.
func GetNullableStringSlice ¶
GetNullableStringSlice get a string pointer slice from object by key.
func GetNullableUUID ¶
GetNullableUUID get an UUID pointer from object by key.
func GetNullableUUIDPtrSlice ¶
GetNullableUUIDPtrSlice get an UUID pointer slice from object by key.
func GetNullableUUIDSlice ¶
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 ¶
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 ¶
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 ¶
GetRawJSON get a raw json.RawMessage value from object by key.
func GetRawJSONDefault ¶
GetRawJSONDefault returns nil if the value is empty.
func GetRawJSONPtrSlice ¶
GetRawJSONPtrSlice get a json.RawMessage pointer slice from object by key.
func GetRawJSONPtrSliceDefault ¶
GetRawJSONPtrSliceDefault get a json.RawMessage pointer slice from object by key.
func GetRawJSONSlice ¶
GetRawJSONSlice get a raw json.RawMessage slice from object by key.
func GetRawJSONSliceDefault ¶
GetRawJSONSliceDefault get a raw json.RawMessage slice from object by key.
func GetSortedKeys ¶
GetSortedKeys gets keys of a map and sorts them.
func GetSortedValuesByKey ¶
GetSortedValuesByKey gets values of a map and sorts by keys.
func GetStringDefault ¶
GetStringDefault returns an empty string if the value is null.
func GetStringPtrSlice ¶
GetStringPtrSlice get a string pointer slice value from object by key.
func GetStringPtrSliceDefault ¶
GetStringPtrSliceDefault get a string pointer slice value from object by key.
func GetStringSlice ¶
GetStringSlice get a string slice value from object by key.
func GetStringSliceDefault ¶
GetStringSliceDefault get a string slice value from object by key.
func GetUUIDDefault ¶
GetUUIDDefault returns uuid.Nil if the value is null.
func GetUUIDPtrSlice ¶
GetUUIDPtrSlice get an UUID slice from object by key.
func GetUUIDPtrSliceDefault ¶
GetUUIDPtrSliceDefault get an UUID slice from object by key.
func GetUUIDSlice ¶
GetUUIDSlice get an UUID slice from object by key.
func GetUUIDSliceDefault ¶
GetUUIDSliceDefault 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 GetUintDefault ¶
func GetUintDefault[T uint | uint8 | uint16 | uint32 | uint64]( object map[string]any, key string, ) (T, error)
GetUintDefault gets an unsigned integer value from object by key. Returns 0 if the field is null.
func GetUintPtrSlice ¶
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 GetUintPtrSliceDefault ¶
func GetUintPtrSliceDefault[T uint | uint8 | uint16 | uint32 | uint64]( object map[string]any, key string, ) ([]*T, error)
GetUintPtrSliceDefault get an unsigned integer slice from object by key.
func GetUintSlice ¶
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 GetUintSliceDefault ¶
func GetUintSliceDefault[T uint | uint8 | uint16 | uint32 | uint64]( object map[string]any, key string, ) ([]T, error)
GetUintSliceDefault get an unsigned integer slice from object by key.
func JSONAttribute ¶
JSONAttribute creates a OpenTelemetry attribute with JSON data.
func MergeMap ¶
func MergeMap[K comparable, V any](dest map[K]V, src map[K]V) map[K]V
MergeMap merges two value maps into one.
func MergeSchemas ¶
func MergeSchemas(schemas ...*schema.SchemaResponse) (*schema.SchemaResponse, []error)
MergeSchemas merge multiple connector schemas into one schema.
func ParseBoolMapFromString ¶
ParseBoolMapFromString parses a bool map from a string with format:
<key1>=<value1>;<key2>=<value2>
func ParseFloatMapFromString ¶
ParseFloatMapFromString parses a float map from a string with format:
<key1>=<value1>;<key2>=<value2>
func ParseIntMapFromString ¶
ParseIntMapFromString parses an integer map from a string with format:
<key1>=<value1>;<key2>=<value2>
func ParseIntegerMapFromString ¶
func ParseIntegerMapFromString[T int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64]( input string, ) (map[string]T, error)
ParseIntegerMapFromString parses an integer map from a string with format:
<key1>=<value1>;<key2>=<value2>
func ParseStringMapFromString ¶
ParseStringMapFromString parses a string map from a string with format:
<key1>=<value1>;<key2>=<value2>
func PointersToValues ¶
PointersToValues converts the pointer slice to value slice.
func ResolveArgument ¶
ResolveArgument resolve variables into the argument if exist.
func ResolveArgumentVariables ¶
func ResolveArgumentVariables( arguments map[string]schema.Argument, variables map[string]any, ) (map[string]any, error)
ResolveArgumentVariables resolve variables in arguments if exist. Deprecated: use ResolveArguments instead.
func ResolveArguments ¶
func ResolveArguments( arguments map[string]schema.Argument, variables map[string]any, ) (map[string]any, error)
ResolveArguments resolve variables into request arguments if exist.
func UnwrapPointerFromAny ¶
UnwrapPointerFromAny unwraps pointers from the input any type.
func UnwrapPointerFromAnyToReflectValue ¶
UnwrapPointerFromAnyToReflectValue unwraps pointers from the input any type to the reflection value.
Types ¶
type DecodeTimeOption ¶
type DecodeTimeOption func(*decodeTimeOptions)
DecodeTimeOption abstracts a time decoding option.
func WithBaseUnix ¶
func WithBaseUnix(base time.Duration) DecodeTimeOption
WithBaseUnix sets the base unix value to decode date time or duration.
func WithTimeParser ¶
func WithTimeParser(parser func(string) (time.Time, error)) DecodeTimeOption
WithTimeParser sets the time parser function to decode date time.
type EnvBool ¶
type EnvBool struct {
Value *bool `json:"value,omitempty" jsonschema:"anyof_required=value" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env" mapstructure:"env" yaml:"env,omitempty"`
}
EnvBool represents either a literal boolean or an environment reference.
func NewEnvBool ¶
NewEnvBool creates an EnvBool instance.
func NewEnvBoolValue ¶
NewEnvBoolValue creates an EnvBool with a literal value.
func NewEnvBoolVariable ¶
NewEnvBoolVariable creates an EnvBool with a variable name.
func (EnvBool) GetOrDefault ¶
GetOrDefault returns the default value if the environment value is empty.
func (*EnvBool) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type EnvFloat ¶
type EnvFloat struct {
Value *float64 `json:"value,omitempty" jsonschema:"anyof_required=value" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env" mapstructure:"env" yaml:"env,omitempty"`
}
EnvFloat represents either a literal floating point number or an environment reference.
func NewEnvFloat ¶
NewEnvFloat creates an EnvFloat instance.
func NewEnvFloatValue ¶
NewEnvFloatValue creates an EnvFloat with a literal value.
func NewEnvFloatVariable ¶
NewEnvFloatVariable creates an EnvFloat with a variable name.
func (EnvFloat) GetOrDefault ¶
GetOrDefault returns the default value if the environment value is empty.
func (*EnvFloat) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type EnvInt ¶
type EnvInt struct {
Value *int64 `json:"value,omitempty" jsonschema:"anyof_required=value" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env" mapstructure:"env" yaml:"env,omitempty"`
}
EnvInt represents either a literal integer or an environment reference.
func NewEnvIntValue ¶
NewEnvIntValue creates an EnvInt with a literal value.
func NewEnvIntVariable ¶
NewEnvIntVariable creates an EnvInt with a variable name.
func (EnvInt) GetOrDefault ¶
GetOrDefault returns the default value if the environment value is empty.
func (*EnvInt) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type EnvMapBool ¶
type EnvMapBool struct {
Value map[string]bool `json:"value,omitempty" jsonschema:"anyof_required=value" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env" mapstructure:"env" yaml:"env,omitempty"`
}
EnvMapBool represents either a literal bool map or an environment reference.
func NewEnvMapBool ¶
func NewEnvMapBool(env string, value map[string]bool) EnvMapBool
NewEnvMapBool creates an EnvMapBool instance.
func NewEnvMapBoolValue ¶
func NewEnvMapBoolValue(value map[string]bool) EnvMapBool
NewEnvMapBoolValue creates an EnvMapBool with a literal value.
func NewEnvMapBoolVariable ¶
func NewEnvMapBoolVariable(name string) EnvMapBool
NewEnvMapBoolVariable creates an EnvMapBool with a variable name.
func (EnvMapBool) Get ¶
func (ev EnvMapBool) Get() (map[string]bool, error)
Get gets literal value or from system environment.
func (*EnvMapBool) UnmarshalJSON ¶
func (ev *EnvMapBool) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type EnvMapFloat ¶
type EnvMapFloat struct {
Value map[string]float64 `json:"value,omitempty" jsonschema:"anyof_required=value" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env" mapstructure:"env" yaml:"env,omitempty"`
}
EnvMapFloat represents either a literal float map or an environment reference.
func NewEnvMapFloat ¶
func NewEnvMapFloat(env string, value map[string]float64) EnvMapFloat
NewEnvMapFloat creates an EnvMapFloat instance.
func NewEnvMapFloatValue ¶
func NewEnvMapFloatValue(value map[string]float64) EnvMapFloat
NewEnvMapFloatValue creates an EnvMapFloat with a literal value.
func NewEnvMapFloatVariable ¶
func NewEnvMapFloatVariable(name string) EnvMapFloat
NewEnvMapFloatVariable creates an EnvMapFloat with a variable name.
func (EnvMapFloat) Get ¶
func (ev EnvMapFloat) Get() (map[string]float64, error)
Get gets literal value or from system environment.
func (*EnvMapFloat) UnmarshalJSON ¶
func (ev *EnvMapFloat) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type EnvMapInt ¶
type EnvMapInt struct {
Value map[string]int64 `json:"value,omitempty" jsonschema:"anyof_required=value" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env" mapstructure:"env" yaml:"env,omitempty"`
}
EnvMapInt represents either a literal int map or an environment reference.
func NewEnvMapInt ¶
NewEnvMapInt creates an EnvMapInt instance.
func NewEnvMapIntValue ¶
NewEnvMapIntValue creates an EnvMapInt with a literal value.
func NewEnvMapIntVariable ¶
NewEnvMapIntVariable creates an EnvMapInt with a variable name.
func (*EnvMapInt) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type EnvMapString ¶
type EnvMapString struct {
Value map[string]string `json:"value,omitempty" jsonschema:"anyof_required=value" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env" mapstructure:"env" yaml:"env,omitempty"`
}
EnvMapString represents either a literal string map or an environment reference.
func NewEnvMapString ¶
func NewEnvMapString(env string, value map[string]string) EnvMapString
NewEnvMapString creates an EnvMapString instance.
func NewEnvMapStringValue ¶
func NewEnvMapStringValue(value map[string]string) EnvMapString
NewEnvMapStringValue creates an EnvMapString with a literal value.
func NewEnvMapStringVariable ¶
func NewEnvMapStringVariable(name string) EnvMapString
NewEnvMapStringVariable creates an EnvMapString with a variable name.
func (EnvMapString) Get ¶
func (ev EnvMapString) Get() (map[string]string, error)
Get gets literal value or from system environment.
func (*EnvMapString) UnmarshalJSON ¶
func (ev *EnvMapString) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type EnvString ¶
type EnvString struct {
Value *string `json:"value,omitempty" jsonschema:"anyof_required=value" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env" mapstructure:"env" yaml:"env,omitempty"`
}
EnvString represents either a literal string or an environment reference.
func NewEnvString ¶
NewEnvString creates an EnvString instance.
func NewEnvStringValue ¶
NewEnvStringValue creates an EnvString with a literal value.
func NewEnvStringVariable ¶
NewEnvStringVariable creates an EnvString with a variable name.
func (EnvString) GetOrDefault ¶
GetOrDefault returns the default value if the environment value is empty.
func (*EnvString) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
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.