Documentation
¶
Index ¶
- func DecodeJSONRaw[T any](raw json.RawMessage) (T, error)
- func EncodeToJSONRaw(value any) (json.RawMessage, error)
- func MapToStructWithJSONTags(data map[string]any, out any) error
- func RequireNonNilPointer(p any, name string) (reflect.Value, error)
- func RequirePointerToStruct(p any, name string) (reflect.Value, error)
- func StructWithJSONTagsToMap(data any) (map[string]any, error)
- type Base64StringEncoderDecoder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeJSONRaw ¶
func DecodeJSONRaw[T any](raw json.RawMessage) (T, error)
DecodeJSONRaw decodes a json.RawMessage into a typed value T, disallowing unknown fields and rejecting trailing data. If raw is empty, or only whitespace, it returns the zero value of T.
func EncodeToJSONRaw ¶
func EncodeToJSONRaw(value any) (json.RawMessage, error)
EncodeToJSONRaw encodes any value to json.RawMessage. No typed method here as value being of a type doesnt really affect its functionality.
func RequirePointerToStruct ¶
Types ¶
type Base64StringEncoderDecoder ¶
type Base64StringEncoderDecoder struct{}
Base64StringEncoderDecoder is a simple KeyEncoderDecoder that uses base64.
func (Base64StringEncoderDecoder) Decode ¶
func (b Base64StringEncoderDecoder) Decode(encoded string) (string, error)
func (Base64StringEncoderDecoder) Encode ¶
func (b Base64StringEncoderDecoder) Encode(plain string) string
Click to show internal directories.
Click to hide internal directories.