Documentation
¶
Index ¶
- func Marshal[S Serializer](values ...S) ([]byte, error)
- func MarshalMath(values ...element) ([]byte, error)
- func MarshalStd(a any) ([]byte, error)
- func NewArray[S Serializer](values []S) (*array[S], error)
- func NewArrayWithNew[S Serializer](newFunction func() S) (*array[S], error)
- func NewElementArray[E element](factors []E) (element, error)
- func NewUnmarshaller(raw []byte) (*unmarshaller, error)
- func Unmarshal[S Serializer](data []byte, values ...S) error
- func UnmarshalTo[S Serializer](data []byte, newFunction func() S) ([]S, error)
- type Element
- type Serializer
- type Values
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Marshal ¶
func Marshal[S Serializer](values ...S) ([]byte, error)
Marshal marshals the passed serializers into a single byte slice.
func MarshalMath ¶
MarshalMath marshals the passed elements into a single byte slice.
func MarshalStd ¶
MarshalStd marshals the passed value using standard ASN.1 encoding.
func NewArray ¶
func NewArray[S Serializer](values []S) (*array[S], error)
NewArray returns a new Serializer representing an array of serializers.
func NewArrayWithNew ¶
func NewArrayWithNew[S Serializer](newFunction func() S) (*array[S], error)
NewArrayWithNew returns a new Serializer representing an array of serializers created by the provided function.
func NewElementArray ¶
func NewElementArray[E element](factors []E) (element, error)
NewElementArray returns a new element representing an array of elements.
func NewUnmarshaller ¶
NewUnmarshaller returns a new unmarshaller for the passed byte slice.
func Unmarshal ¶
func Unmarshal[S Serializer](data []byte, values ...S) error
Unmarshal unmarshals the passed byte slice into the provided serializers.
func UnmarshalTo ¶
func UnmarshalTo[S Serializer](data []byte, newFunction func() S) ([]S, error)
UnmarshalTo unmarshals the passed byte slice into a slice of serializers created by the provided function.
Types ¶
type Serializer ¶
Serializer defines an interface for serializing and deserializing values.