marshaling

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2022 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Marshalizer

type Marshalizer interface {
	Marshal(data interface{}) ([]byte, error)
	Unmarshal(data interface{}, dataBytes []byte) error
	IsInterfaceNil() bool
}

Marshalizer deals with messages serialization

func CreateMarshalizer

func CreateMarshalizer(kind MarshalizerKind) Marshalizer

CreateMarshalizer creates a marshalizer with the specified kind

type MarshalizerKind

type MarshalizerKind uint32

MarshalizerKind is the kind of a message (that is passed between the Node and Andes)

const (
	// JSON is a marshalizer kind
	JSON MarshalizerKind = iota
	// Gob is a marshalizer kind
	Gob
)

func ParseKind

func ParseKind(str string) MarshalizerKind

ParseKind gets a kind from a string

Jump to

Keyboard shortcuts

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