marshal

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMarshallingProto = errors.New("can not serialize the object")

ErrMarshallingProto is raised when the object does not implement proto.Message

View Source
var ErrUnmarshallingProto = errors.New("obj does not implement proto.Message")

ErrUnmarshallingProto is raised when the object that needs to be unmarshaled does not implement proto.Message

Functions

This section is empty.

Types

type GogoProtoMarshalizer

type GogoProtoMarshalizer struct {
}

GogoProtoMarshalizer implements marshaling with protobuf

func (*GogoProtoMarshalizer) IsInterfaceNil

func (gpm *GogoProtoMarshalizer) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*GogoProtoMarshalizer) Marshal

func (gpm *GogoProtoMarshalizer) Marshal(obj interface{}) ([]byte, error)

Marshal does the actual serialization of an object The object to be serialized must implement the gogoProtoObj interface

func (*GogoProtoMarshalizer) Unmarshal

func (gpm *GogoProtoMarshalizer) Unmarshal(obj interface{}, buff []byte) error

Unmarshal does the actual deserialization of an object The object to be deserialized must implement the gogoProtoObj interface

type GogoProtoObj

type GogoProtoObj interface {
	gproto.Marshaler
	gproto.Unmarshaler
	proto.Message
}

GogoProtoObj groups the necessary of a gogo protobuf marshalizeble object

type JSONMarshalizer added in v1.0.2

type JSONMarshalizer struct {
}

JSONMarshalizer -

func (*JSONMarshalizer) IsInterfaceNil added in v1.0.2

func (marshalizer *JSONMarshalizer) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*JSONMarshalizer) Marshal added in v1.0.2

func (marshalizer *JSONMarshalizer) Marshal(obj interface{}) ([]byte, error)

Marshal does the actual serialization of an object

func (*JSONMarshalizer) Unmarshal added in v1.0.2

func (marshalizer *JSONMarshalizer) Unmarshal(obj interface{}, buff []byte) error

Unmarshal does the actual deserialization of an object

type TestData

type TestData struct {
	proto.TestData
}

TestData -

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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