converter

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2021 License: Apache-2.0 Imports: 13 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 FromDocumentKeys

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

FromDocumentKeys converts the given Protobuf format to model format.

func FromEventType

func FromEventType(pbEventType api.EventType) (types.EventType, error)

FromEventType 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 ToClientsMap

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

ToClientsMap converts the given model to Protobuf format.

func ToDocumentKeys

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

ToDocumentKeys converts the given model format to Protobuf format.

func ToEventType

func ToEventType(eventType types.EventType) (api.EventType, error)

ToEventType converts the given model format 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