Documentation ¶
Index ¶
- Variables
- func HasValue[TEnum ~int32](value TEnum) bool
- func MarshalString[TIn ~int32, TMap ~int32, TAlt ~int32](data TIn, mapping map[TMap]string, alternates map[TAlt]string, quote bool) string
- func NoValue[TEnum ~int32]() TEnum
- func ScanValue[TMap ~int32, TAlt ~int32, TOut ~int32](value interface{}, mapping map[string]TMap, alternates map[string]TAlt, ...) error
- func UnmarshalString[TMap ~int32, TAlt ~int32, TOut ~int32](value string, mapping map[string]TMap, alternates map[string]TAlt, data *TOut) error
- func UnmarshalValue[TMap ~int32, TAlt ~int32, TOut ~int32](raw []byte, mapping map[string]TMap, alternates map[string]TAlt, data *TOut) error
Constants ¶
This section is empty.
Variables ¶
var Ignore = make(map[int32]string)
Ignore is an empty map that can be used in place of alternate values for the marshaller
var None = make(map[string]int32)
None is an empty map that can be used in place of alternate values for the unmarshaller
Functions ¶
func HasValue ¶ added in v1.3.8
HasValue returns true if the value provided represents an actual enum value, or false if the value is equivalent to what would be produced by calling NoValue for that enum
func MarshalString ¶ added in v1.1.1
func MarshalString[TIn ~int32, TMap ~int32, TAlt ~int32](data TIn, mapping map[TMap]string, alternates map[TAlt]string, quote bool) string
MarshalString converts an enum value to a string based on the _value mapping and a possible alternative mapping
func NoValue ¶ added in v1.3.6
func NoValue[TEnum ~int32]() TEnum
NoValue returns the equivalent of no-value for one of the common financial enums. This function can be used when the user wants to deactivate a filter that relies on an enum message type
func ScanValue ¶
func ScanValue[TMap ~int32, TAlt ~int32, TOut ~int32](value interface{}, mapping map[string]TMap, alternates map[string]TAlt, data *TOut) error
ScanValue is intended to be used by functions that want to implement the Scanner interface for converting SQL values to enums
Types ¶
This section is empty.