serializer

package
v0.0.0-...-d341122 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2023 License: BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotImplementProtoMessage = errors.New("param does not implement proto.Message")

ErrNotImplementProtoMessage refers to param not implemented by proto.Message

Functions

This section is empty.

Types

type ProtoSerializer

type ProtoSerializer struct {
}

ProtoSerializer implements the Serializer interface

func (ProtoSerializer) Marshal

func (p ProtoSerializer) Marshal(message interface{}) ([]byte, error)

Marshal .

func (ProtoSerializer) Unmarshal

func (p ProtoSerializer) Unmarshal(data []byte, message interface{}) error

Unmarshal .

type Serializer

type Serializer interface {
	Marshal(message interface{}) ([]byte, error)
	Unmarshal(data []byte, message interface{}) error
}

Serializer is interface, each serializer has Marshal and Unmarshal functions

Jump to

Keyboard shortcuts

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