serialize

package
v0.18.15 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIncorrectWrapper = errors.New("incorrect wrapper")
)

Functions

func NewAminoStrategy

func NewAminoStrategy(cdc *amino.Codec) *aminoStrategy

NewAminoStrategy generates a new object for amino serialization with amino codec

func RegisterConcrete

func RegisterConcrete(obj interface{}, name string)

func RegisterInterface

func RegisterInterface(obj interface{})

functions to register types

Types

type Channel

type Channel int
const (
	CLIENT Channel = iota
	PERSISTENT
	NETWORK
	LOCAL
	JSON
)

type Data

type Data interface {
	SerialTag() string
}

type DataAdapter

type DataAdapter interface {
	NewDataInstance() Data
	Data() Data
	SetData(interface{}) error
}

type Serializer

type Serializer interface {
	Serialize(obj interface{}) ([]byte, error)
	Deserialize(d []byte, obj interface{}) error
}
var JSONSzr Serializer

func GetSerializer

func GetSerializer(channel Channel, args ...interface{}) Serializer

GetSerializer for a channel of standard types, default is a JSON serializer

Jump to

Keyboard shortcuts

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