serializer

package
v0.0.0-...-11dff32 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

NotImplementProtoMessageError refers to param not implemented by proto.Message

Functions

This section is empty.

Types

type JsonSerializer

type JsonSerializer struct{}

Json .serializer

func (JsonSerializer) Decode

func (_ JsonSerializer) Decode(data []byte, message interface{}) error

Unmarshal .

func (JsonSerializer) Encode

func (_ JsonSerializer) Encode(message interface{}) ([]byte, error)

Marshal .

func (JsonSerializer) Type

func (JsonSerializer) Type() string

type ProtoSerializer

type ProtoSerializer struct {
}

ProtoSerializer implements the Serializer interface

func (ProtoSerializer) Decode

func (_ ProtoSerializer) Decode(data []byte, message interface{}) error

Unmarshal .

func (ProtoSerializer) Encode

func (_ ProtoSerializer) Encode(message interface{}) ([]byte, error)

Marshal .

func (ProtoSerializer) Type

func (ProtoSerializer) Type() string

type Serializer

type Serializer interface {
	Encode(message interface{}) ([]byte, error)
	Decode(data []byte, message interface{}) error
	Type() string
}

Jump to

Keyboard shortcuts

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