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.