Documentation ¶
Index ¶
- func Convert[V1 any, V2 any](v V1, v1 Format[V1], v2 Format[V2]) (V2, error)
- type Base64Format
- func (helper Base64Format) Default() string
- func (helper Base64Format) FromJson(value []byte) (string, error)
- func (helper Base64Format) Marshal(value string) ([]byte, error)
- func (helper Base64Format) ToJson(value string) ([]byte, error)
- func (helper Base64Format) Unmarshal(value []byte) (string, error)
- type BytesFormat
- func (helper BytesFormat) Default() []byte
- func (helper BytesFormat) FromJson(value []byte) ([]byte, error)
- func (helper BytesFormat) Marshal(value []byte) ([]byte, error)
- func (helper BytesFormat) ToJson(value []byte) ([]byte, error)
- func (helper BytesFormat) Unmarshal(value []byte) ([]byte, error)
- type BytesJson
- type Format
- type JsonFormat
- type ProtobufFormat
- func (helper ProtobufFormat[T]) Default() T
- func (helper ProtobufFormat[T]) FromJson(value []byte) (T, error)
- func (helper ProtobufFormat[T]) Marshal(value T) ([]byte, error)
- func (helper ProtobufFormat[T]) ToJson(value T) ([]byte, error)
- func (helper ProtobufFormat[T]) Unmarshal(value []byte) (T, error)
- type StringFormat
- func (helper StringFormat) Default() string
- func (helper StringFormat) FromJson(value []byte) (string, error)
- func (helper StringFormat) Marshal(value string) ([]byte, error)
- func (helper StringFormat) ToJson(value string) ([]byte, error)
- func (helper StringFormat) Unmarshal(value []byte) (string, error)
- type StringJson
- type YamlFormat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Base64Format ¶
type Base64Format struct { }
func (Base64Format) Default ¶
func (helper Base64Format) Default() string
type BytesFormat ¶
type BytesFormat struct { }
func (BytesFormat) Default ¶
func (helper BytesFormat) Default() []byte
type Format ¶
type Format[T any] interface { Default() T Marshal(T) ([]byte, error) Unmarshal([]byte) (T, error) ToJson(T) ([]byte, error) FromJson([]byte) (T, error) }
bytes format
type JsonFormat ¶
type JsonFormat[T any] struct{}
func (JsonFormat[T]) Default ¶
func (helper JsonFormat[T]) Default() T
func (JsonFormat[T]) FromJson ¶
func (helper JsonFormat[T]) FromJson(value []byte) (T, error)
func (JsonFormat[T]) Marshal ¶
func (helper JsonFormat[T]) Marshal(value T) ([]byte, error)
func (JsonFormat[T]) ToJson ¶
func (helper JsonFormat[T]) ToJson(value T) ([]byte, error)
func (JsonFormat[T]) Unmarshal ¶
func (helper JsonFormat[T]) Unmarshal(value []byte) (T, error)
type ProtobufFormat ¶
func (ProtobufFormat[T]) Default ¶
func (helper ProtobufFormat[T]) Default() T
func (ProtobufFormat[T]) FromJson ¶
func (helper ProtobufFormat[T]) FromJson(value []byte) (T, error)
func (ProtobufFormat[T]) Marshal ¶
func (helper ProtobufFormat[T]) Marshal(value T) ([]byte, error)
func (ProtobufFormat[T]) ToJson ¶
func (helper ProtobufFormat[T]) ToJson(value T) ([]byte, error)
func (ProtobufFormat[T]) Unmarshal ¶
func (helper ProtobufFormat[T]) Unmarshal(value []byte) (T, error)
type StringFormat ¶
type StringFormat struct { }
func (StringFormat) Default ¶
func (helper StringFormat) Default() string
type StringJson ¶
type StringJson struct {
Message string
}
type YamlFormat ¶
type YamlFormat[T any] struct{}
func (YamlFormat[T]) Default ¶
func (helper YamlFormat[T]) Default() T
func (YamlFormat[T]) FromJson ¶
func (helper YamlFormat[T]) FromJson(value []byte) (T, error)
func (YamlFormat[T]) Marshal ¶
func (helper YamlFormat[T]) Marshal(value T) ([]byte, error)
func (YamlFormat[T]) ToJson ¶
func (helper YamlFormat[T]) ToJson(value T) ([]byte, error)
func (YamlFormat[T]) Unmarshal ¶
func (helper YamlFormat[T]) Unmarshal(value []byte) (T, error)
Click to show internal directories.
Click to hide internal directories.