serialize

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2020 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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