converter

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrPackRequired is returned when an empty pack is passed.
	ErrPackRequired = errors.New("pack required")

	// ErrCheckpointRequired is returned when a pack with an empty checkpoint is
	// passed.
	ErrCheckpointRequired = errors.New("checkpoint required")

	// ErrUnsupportedOperation is returned when the given operation is not
	// supported yet.
	ErrUnsupportedOperation = errors.New("unsupported operation")

	// ErrUnsupportedElement is returned when the given element is not
	// supported yet.
	ErrUnsupportedElement = errors.New("unsupported element")

	// ErrUnsupportedEventType is returned when the given event type is not
	// supported yet.
	ErrUnsupportedEventType = errors.New("unsupported event type")

	// ErrUnsupportedValueType is returned when the given value type is not
	// supported yet.
	ErrUnsupportedValueType = errors.New("unsupported value type")

	// ErrUnsupportedCounterType is returned when the given counter type is not
	// supported yet.
	ErrUnsupportedCounterType = errors.New("unsupported counter type")
)

Functions

func BytesToObject

func BytesToObject(snapshot []byte) (*json.Object, error)

BytesToObject creates an Object from the given byte array.

func FromChangePack

func FromChangePack(pbPack *api.ChangePack) (*change.Pack, error)

FromChangePack converts the given Protobuf format to model format.

func FromClient added in v0.1.2

func FromClient(pbClient *api.Client) (*types.Client, error)

FromClient converts the given Protobuf format to model format.

func FromClients added in v0.1.6

func FromClients(pbClients *api.Clients) ([]*types.Client, error)

FromClients converts the given Protobuf format to model format.

func FromDocEvent added in v0.1.6

func FromDocEvent(docEvent *api.DocEvent) (*sync.DocEvent, error)

FromDocEvent converts the given Protobuf format to model format.

func FromDocumentKeys

func FromDocumentKeys(pbKeys []*api.DocumentKey) []*key.Key

FromDocumentKeys converts the given Protobuf format to model format.

func FromEventType

func FromEventType(pbDocEventType api.DocEventType) (types.DocEventType, error)

FromEventType converts the given Protobuf format to model format.

func FromMetadataInfo added in v0.1.7

func FromMetadataInfo(pbMetadata *api.Metadata) types.MetadataInfo

FromMetadataInfo converts the given Protobuf format to model format.

func FromOperations

func FromOperations(pbOps []*api.Operation) ([]operation.Operation, error)

FromOperations converts the given Protobuf format to model format.

func ObjectToBytes

func ObjectToBytes(obj *json.Object) ([]byte, error)

ObjectToBytes converts the given object to byte array.

func ToChangePack

func ToChangePack(pack *change.Pack) (*api.ChangePack, error)

ToChangePack converts the given model format to Protobuf format.

func ToClient added in v0.1.2

func ToClient(client types.Client) *api.Client

ToClient converts the given model to Protobuf format.

func ToClientsMap

func ToClientsMap(clientsMap map[string][]types.Client) map[string]*api.Clients

ToClientsMap converts the given model to Protobuf format.

func ToDocEvent added in v0.1.6

func ToDocEvent(docEvent sync.DocEvent) (*api.DocEvent, error)

ToDocEvent converts the given model to Protobuf format.

func ToDocEventType added in v0.1.6

func ToDocEventType(eventType types.DocEventType) (api.DocEventType, error)

ToDocEventType converts the given model format to Protobuf format.

func ToDocumentKeys

func ToDocumentKeys(keys []*key.Key) []*api.DocumentKey

ToDocumentKeys converts the given model format to Protobuf format.

func ToMetadataInfo added in v0.1.7

func ToMetadataInfo(metadata types.MetadataInfo) *api.Metadata

ToMetadataInfo converts the given model to Protobuf format.

func ToOperations

func ToOperations(operations []operation.Operation) ([]*api.Operation, error)

ToOperations converts the given model format to Protobuf format.

Types

This section is empty.

Jump to

Keyboard shortcuts

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