Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrFormatConversionMarshal = errors.New("format conversion error") ErrFormatConversionUnmarshal = errors.New("format conversion error") )
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) }
bytes format
type GengarFormat ¶ added in v0.0.12
type GengarFormat struct { }
because gengar likes to play pranks. for unit testing broken format results
func (GengarFormat) Default ¶ added in v0.0.12
func (helper GengarFormat) Default() string
type JsonFormat ¶
type JsonFormat[T any] struct{}
func (JsonFormat[T]) Default ¶
func (helper JsonFormat[T]) Default() T
func (JsonFormat[T]) Marshal ¶
func (helper JsonFormat[T]) Marshal(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]) Marshal ¶
func (helper ProtobufFormat[T]) Marshal(value T) ([]byte, error)
func (ProtobufFormat[T]) Unmarshal ¶
func (helper ProtobufFormat[T]) Unmarshal(value []byte) (T, error)
type ProtojsonFormat ¶ added in v0.0.12
func (ProtojsonFormat[T]) Default ¶ added in v0.0.12
func (helper ProtojsonFormat[T]) Default() T
func (ProtojsonFormat[T]) Marshal ¶ added in v0.0.12
func (helper ProtojsonFormat[T]) Marshal(value T) ([]byte, error)
func (ProtojsonFormat[T]) Unmarshal ¶ added in v0.0.12
func (helper ProtojsonFormat[T]) Unmarshal(value []byte) (T, error)
type StringFormat ¶
type StringFormat struct { }
func (StringFormat) Default ¶
func (helper StringFormat) Default() string
type YamlFormat ¶
type YamlFormat[T any] struct{}
func (YamlFormat[T]) Default ¶
func (helper YamlFormat[T]) Default() T
func (YamlFormat[T]) Marshal ¶
func (helper YamlFormat[T]) Marshal(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.