spi

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewData

func NewData(payload []byte) serialization.Data

NewData return serialization Data with the given payload.

Types

type SerializationService

type SerializationService interface {
	// ToObject deserializes the given data to an object.
	// It can safely be called on an object that is already deserialized. In that case, that instance
	// is returned.
	// If this is called with nil, nil is returned.
	ToObject(data serialization.Data) (interface{}, error)
	// ToData serializes an object to a data.
	// It can safely be called with a Data. In that case, that instance is returned.
	// If it is called with nil, nil is returned.
	ToData(object interface{}) (serialization.Data, error)
}

SerializationService is used to serialize user objects to Data and deserialize data to objects.

func NewSerializationService

func NewSerializationService(serializationConfig *serialization.Config) (SerializationService, error)

NewSerializationService creates and returns a new serialization service with the given config.

Jump to

Keyboard shortcuts

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