marshal

package
v0.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CapnpMarshalizer

type CapnpMarshalizer struct {
}

CapnpMarshalizer implements marshaling with capnproto

func (*CapnpMarshalizer) Marshal

func (x *CapnpMarshalizer) Marshal(obj interface{}) ([]byte, error)

Marshal does the actual serialization of an object through capnproto The object to be serialized must implement the data.CapnpHelper interface

func (*CapnpMarshalizer) Unmarshal

func (x *CapnpMarshalizer) Unmarshal(obj interface{}, buff []byte) error

Unmarshal does the actual deserialization of an object through capnproto The object to be deserialized must implement the data.CapnpHelper interface

type JsonMarshalizer

type JsonMarshalizer struct {
}

JsonMarshalizer implements Marshalizer interface using JSON format

func (JsonMarshalizer) Marshal

func (j JsonMarshalizer) Marshal(obj interface{}) ([]byte, error)

Marshal tries to serialize obj parameter

func (JsonMarshalizer) Unmarshal

func (j JsonMarshalizer) Unmarshal(obj interface{}, buff []byte) error

Unmarshal tries to deserialize input buffer values into input object

type Marshalizer

type Marshalizer interface {
	Marshal(obj interface{}) ([]byte, error)
	Unmarshal(obj interface{}, buff []byte) error
}

Marshalizer defines the 2 basic operations: serialize (marshal) and deserialize (unmarshal)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL