Documentation
¶
Overview ¶
Package defines Spec which is a type to define marshaling behavior.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BytesCompatible ¶
Type compatible with byte array
type Spec ¶
type Spec[S any] interface { // Convert a provided value into a byte array Marshal(v S) ([]byte, error) // Convert a provided a byte array into a value. // This should be an inverse operation of Marshal. Unmarshal([]byte) (S, error) }
Specification of marshaling.
func Bytes ¶
func Bytes[S BytesCompatible]() Spec[S]
Create a bytes spec.
This Spec simply cast a BytesCompatible type into a byte array.
Click to show internal directories.
Click to hide internal directories.