protobufserializer

package
Version: v0.0.0-...-8e6450d Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProtobufStateSerializer

type ProtobufStateSerializer struct{}

ProtobufStateSerializer is a StateSerializer that uses base64 encoded protobufs.

func (ProtobufStateSerializer) Deserialize

func (p ProtobufStateSerializer) Deserialize(serialized string, state interface{}) error

Deserialize base64 decodes the given string then unmarshalls the bytes into the struct using protobuf. The struct passed to Deserialize must satisfy proto.Message.

func (ProtobufStateSerializer) Serialize

func (p ProtobufStateSerializer) Serialize(state interface{}) (string, error)

Serialize serializes the given struct into bytes with protobuf, then base64 encodes it. The struct passed to Serialize must satisfy proto.Message.

Source Files

Jump to

Keyboard shortcuts

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