model

package
v0.0.0-...-cc9b1f3 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: Apache-2.0 Imports: 22 Imported by: 8

Documentation

Overview

Package model is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const Agent = "orda-go"

Agent is the sdk name

View Source
const ProtocolVersion = "v1"

ProtocolVersion is the version of the protocol.

Variables

View Source
var (
	SyncType_name = map[int32]string{
		0: "LOCAL_ONLY",
		1: "MANUALLY",
		2: "REALTIME",
	}
	SyncType_value = map[string]int32{
		"LOCAL_ONLY": 0,
		"MANUALLY":   1,
		"REALTIME":   2,
	}
)

Enum value maps for SyncType.

View Source
var (
	ClientType_name = map[int32]string{
		0: "PERSISTENT",
		1: "EPHEMERAL",
		2: "VOLATILE",
	}
	ClientType_value = map[string]int32{
		"PERSISTENT": 0,
		"EPHEMERAL":  1,
		"VOLATILE":   2,
	}
)

Enum value maps for ClientType.

View Source
var (
	TypeOfOperation_name = map[int32]string{
		0:  "NO_OP",
		1:  "ERROR",
		2:  "TRANSACTION",
		10: "COUNTER_SNAPSHOT",
		11: "COUNTER_INCREASE",
		20: "MAP_SNAPSHOT",
		21: "MAP_PUT",
		22: "MAP_REMOVE",
		30: "LIST_SNAPSHOT",
		31: "LIST_INSERT",
		32: "LIST_DELETE",
		33: "LIST_UPDATE",
		40: "DOC_SNAPSHOT",
		41: "DOC_OBJ_PUT",
		42: "DOC_OBJ_RMV",
		43: "DOC_ARR_INS",
		44: "DOC_ARR_DEL",
		45: "DOC_ARR_UPD",
	}
	TypeOfOperation_value = map[string]int32{
		"NO_OP":            0,
		"ERROR":            1,
		"TRANSACTION":      2,
		"COUNTER_SNAPSHOT": 10,
		"COUNTER_INCREASE": 11,
		"MAP_SNAPSHOT":     20,
		"MAP_PUT":          21,
		"MAP_REMOVE":       22,
		"LIST_SNAPSHOT":    30,
		"LIST_INSERT":      31,
		"LIST_DELETE":      32,
		"LIST_UPDATE":      33,
		"DOC_SNAPSHOT":     40,
		"DOC_OBJ_PUT":      41,
		"DOC_OBJ_RMV":      42,
		"DOC_ARR_INS":      43,
		"DOC_ARR_DEL":      44,
		"DOC_ARR_UPD":      45,
	}
)

Enum value maps for TypeOfOperation.

View Source
var (
	StateOfDatatype_name = map[int32]string{
		0: "DUE_TO_CREATE",
		1: "DUE_TO_SUBSCRIBE",
		2: "DUE_TO_SUBSCRIBE_CREATE",
		3: "SUBSCRIBED",
		4: "DUE_TO_UNSUBSCRIBE",
		5: "CLOSED",
		6: "DELETED",
	}
	StateOfDatatype_value = map[string]int32{
		"DUE_TO_CREATE":           0,
		"DUE_TO_SUBSCRIBE":        1,
		"DUE_TO_SUBSCRIBE_CREATE": 2,
		"SUBSCRIBED":              3,
		"DUE_TO_UNSUBSCRIBE":      4,
		"CLOSED":                  5,
		"DELETED":                 6,
	}
)

Enum value maps for StateOfDatatype.

View Source
var (
	StateOfResponse_name = map[int32]string{
		0:   "OK",
		101: "ERR_CLIENT_INVALID_COLLECTION",
		102: "ERR_CLIENT_INVALID_SYNC_TYPE",
	}
	StateOfResponse_value = map[string]int32{
		"OK":                            0,
		"ERR_CLIENT_INVALID_COLLECTION": 101,
		"ERR_CLIENT_INVALID_SYNC_TYPE":  102,
	}
)

Enum value maps for StateOfResponse.

View Source
var (
	RequestType_name = map[int32]string{
		0: "CLIENTS",
		1: "PUSHPULLS",
	}
	RequestType_value = map[string]int32{
		"CLIENTS":   0,
		"PUSHPULLS": 1,
	}
)

Enum value maps for RequestType.

View Source
var (
	TypeOfDatatype_name = map[int32]string{
		0: "COUNTER",
		1: "MAP",
		2: "LIST",
		3: "DOCUMENT",
	}
	TypeOfDatatype_value = map[string]int32{
		"COUNTER":  0,
		"MAP":      1,
		"LIST":     2,
		"DOCUMENT": 3,
	}
)

Enum value maps for TypeOfDatatype.

View Source
var File_orda_enum_proto protoreflect.FileDescriptor
View Source
var File_orda_grpc_proto protoreflect.FileDescriptor

Functions

func RegisterOrdaServiceHandler

func RegisterOrdaServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterOrdaServiceHandler registers the http handlers for service OrdaService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterOrdaServiceHandlerClient

func RegisterOrdaServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client OrdaServiceClient) error

RegisterOrdaServiceHandlerClient registers the http handlers for service OrdaService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "OrdaServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "OrdaServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "OrdaServiceClient" to call the correct interceptors.

func RegisterOrdaServiceHandlerFromEndpoint

func RegisterOrdaServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterOrdaServiceHandlerFromEndpoint is same as RegisterOrdaServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterOrdaServiceHandlerServer

func RegisterOrdaServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server OrdaServiceServer) error

RegisterOrdaServiceHandlerServer registers the http handlers for service OrdaService to "mux". UnaryRPC :call OrdaServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterOrdaServiceHandlerFromEndpoint instead.

func RegisterOrdaServiceServer

func RegisterOrdaServiceServer(s *grpc.Server, srv OrdaServiceServer)

Types

type CheckPoint

type CheckPoint struct {

	// @inject_tag: bson:"s",json:"s"
	Sseq uint64 `protobuf:"varint,1,opt,name=sseq,proto3" json:"s" bson:"s"`
	// @inject_tag: bson:"c",json:"c"
	Cseq uint64 `protobuf:"varint,2,opt,name=cseq,proto3" json:"c" bson:"c"`
	// contains filtered or unexported fields
}

func NewCheckPoint

func NewCheckPoint() *CheckPoint

NewCheckPoint creates a new checkpoint

func NewSetCheckPoint

func NewSetCheckPoint(sseq, cseq uint64) *CheckPoint

NewSetCheckPoint creates a new checkpoint with set values

func (*CheckPoint) Clone

func (its *CheckPoint) Clone() *CheckPoint

Clone makes a carbon copy of this one.

func (*CheckPoint) Compare

func (its *CheckPoint) Compare(other *CheckPoint) bool

Compare returns true if this CheckPoint is equal to other; otherwise, false.

func (*CheckPoint) Descriptor deprecated

func (*CheckPoint) Descriptor() ([]byte, []int)

Deprecated: Use CheckPoint.ProtoReflect.Descriptor instead.

func (*CheckPoint) GetCseq

func (x *CheckPoint) GetCseq() uint64

func (*CheckPoint) GetSseq

func (x *CheckPoint) GetSseq() uint64

func (*CheckPoint) ProtoMessage

func (*CheckPoint) ProtoMessage()

func (*CheckPoint) ProtoReflect

func (x *CheckPoint) ProtoReflect() protoreflect.Message

func (*CheckPoint) Reset

func (x *CheckPoint) Reset()

func (*CheckPoint) Set

func (its *CheckPoint) Set(sseq, cseq uint64) *CheckPoint

Set sets the values of checkpoint

func (*CheckPoint) String

func (x *CheckPoint) String() string

func (*CheckPoint) SyncCseq

func (its *CheckPoint) SyncCseq(cseq uint64) *CheckPoint

SyncCseq syncs Cseq

func (*CheckPoint) ToString

func (its *CheckPoint) ToString() string

ToString returns a short string of CheckPoint

type Client

type Client struct {
	CUID       string     `protobuf:"bytes,1,opt,name=CUID,proto3" json:"CUID,omitempty"`
	Alias      string     `protobuf:"bytes,2,opt,name=alias,proto3" json:"alias,omitempty"`
	Collection string     `protobuf:"bytes,3,opt,name=collection,proto3" json:"collection,omitempty"`
	Type       ClientType `protobuf:"varint,4,opt,name=type,proto3,enum=orda.ClientType" json:"type,omitempty"`
	SyncType   SyncType   `protobuf:"varint,5,opt,name=syncType,proto3,enum=orda.SyncType" json:"syncType,omitempty"`
	// contains filtered or unexported fields
}

func (*Client) Descriptor deprecated

func (*Client) Descriptor() ([]byte, []int)

Deprecated: Use Client.ProtoReflect.Descriptor instead.

func (*Client) GetAlias

func (x *Client) GetAlias() string

func (*Client) GetCUID

func (x *Client) GetCUID() string

func (*Client) GetCollection

func (x *Client) GetCollection() string

func (*Client) GetSummary

func (its *Client) GetSummary() string

GetSummary returns the summary of client

func (*Client) GetSyncType

func (x *Client) GetSyncType() SyncType

func (*Client) GetType

func (x *Client) GetType() ClientType

func (*Client) ProtoMessage

func (*Client) ProtoMessage()

func (*Client) ProtoReflect

func (x *Client) ProtoReflect() protoreflect.Message

func (*Client) Reset

func (x *Client) Reset()

func (*Client) String

func (x *Client) String() string

func (*Client) ToString

func (its *Client) ToString() string

ToString returns customized string

type ClientMessage

type ClientMessage struct {
	Header      *Header    `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
	Collection  string     `protobuf:"bytes,2,opt,name=collection,proto3" json:"collection,omitempty"`
	Cuid        string     `protobuf:"bytes,3,opt,name=cuid,proto3" json:"cuid,omitempty"`
	ClientAlias string     `protobuf:"bytes,4,opt,name=clientAlias,proto3" json:"clientAlias,omitempty"`
	ClientType  ClientType `protobuf:"varint,5,opt,name=clientType,proto3,enum=orda.ClientType" json:"clientType,omitempty"`
	SyncType    SyncType   `protobuf:"varint,6,opt,name=syncType,proto3,enum=orda.SyncType" json:"syncType,omitempty"`
	// contains filtered or unexported fields
}

func NewClientMessage

func NewClientMessage(client *Client) *ClientMessage

NewClientMessage creates a new ClientRequest

func (*ClientMessage) Descriptor deprecated

func (*ClientMessage) Descriptor() ([]byte, []int)

Deprecated: Use ClientMessage.ProtoReflect.Descriptor instead.

func (*ClientMessage) GetClient

func (its *ClientMessage) GetClient() *Client

GetClient returns the model of client

func (*ClientMessage) GetClientAlias

func (x *ClientMessage) GetClientAlias() string

func (*ClientMessage) GetClientSummary

func (its *ClientMessage) GetClientSummary() string

GetClientSummary returns the summary of client

func (*ClientMessage) GetClientType

func (x *ClientMessage) GetClientType() ClientType

func (*ClientMessage) GetCollection

func (x *ClientMessage) GetCollection() string

func (*ClientMessage) GetCuid

func (x *ClientMessage) GetCuid() string

func (*ClientMessage) GetHeader

func (x *ClientMessage) GetHeader() *Header

func (*ClientMessage) GetSyncType

func (x *ClientMessage) GetSyncType() SyncType

func (*ClientMessage) ProtoMessage

func (*ClientMessage) ProtoMessage()

func (*ClientMessage) ProtoReflect

func (x *ClientMessage) ProtoReflect() protoreflect.Message

func (*ClientMessage) Reset

func (x *ClientMessage) Reset()

func (*ClientMessage) String

func (x *ClientMessage) String() string

func (*ClientMessage) ToString

func (its *ClientMessage) ToString() string

ToString returns customized string

type ClientType

type ClientType int32
const (
	ClientType_PERSISTENT ClientType = 0 // persistent clients can generate operations; even if they do not sync, their checkpoints remains for offline support
	ClientType_EPHEMERAL  ClientType = 1 // ephemeral clients can generate operations; if they do not sync for predetermined time, their information is removed
	ClientType_VOLATILE   ClientType = 2 // volatile clients can generate operations on the latest datatype, but no operations are pulled
)

func (ClientType) Descriptor

func (ClientType) Descriptor() protoreflect.EnumDescriptor

func (ClientType) Enum

func (x ClientType) Enum() *ClientType

func (ClientType) EnumDescriptor deprecated

func (ClientType) EnumDescriptor() ([]byte, []int)

Deprecated: Use ClientType.Descriptor instead.

func (ClientType) Number

func (x ClientType) Number() protoreflect.EnumNumber

func (ClientType) String

func (x ClientType) String() string

func (ClientType) Type

type CollectionMessage

type CollectionMessage struct {
	Collection string `protobuf:"bytes,1,opt,name=collection,proto3" json:"collection,omitempty"`
	// contains filtered or unexported fields
}

func (*CollectionMessage) Descriptor deprecated

func (*CollectionMessage) Descriptor() ([]byte, []int)

Deprecated: Use CollectionMessage.ProtoReflect.Descriptor instead.

func (*CollectionMessage) GetCollection

func (x *CollectionMessage) GetCollection() string

func (*CollectionMessage) ProtoMessage

func (*CollectionMessage) ProtoMessage()

func (*CollectionMessage) ProtoReflect

func (x *CollectionMessage) ProtoReflect() protoreflect.Message

func (*CollectionMessage) Reset

func (x *CollectionMessage) Reset()

func (*CollectionMessage) String

func (x *CollectionMessage) String() string

type DatatypeMeta

type DatatypeMeta struct {
	Key    string         `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	DUID   string         `protobuf:"bytes,2,opt,name=DUID,proto3" json:"DUID,omitempty"`
	OpID   *OperationID   `protobuf:"bytes,3,opt,name=opID,proto3" json:"opID,omitempty"`
	TypeOf TypeOfDatatype `protobuf:"varint,4,opt,name=typeOf,proto3,enum=orda.TypeOfDatatype" json:"typeOf,omitempty"`
	// contains filtered or unexported fields
}

func (*DatatypeMeta) Descriptor deprecated

func (*DatatypeMeta) Descriptor() ([]byte, []int)

Deprecated: Use DatatypeMeta.ProtoReflect.Descriptor instead.

func (*DatatypeMeta) GetDUID

func (x *DatatypeMeta) GetDUID() string

func (*DatatypeMeta) GetKey

func (x *DatatypeMeta) GetKey() string

func (*DatatypeMeta) GetOpID

func (x *DatatypeMeta) GetOpID() *OperationID

func (*DatatypeMeta) GetTypeOf

func (x *DatatypeMeta) GetTypeOf() TypeOfDatatype

func (*DatatypeMeta) ProtoMessage

func (*DatatypeMeta) ProtoMessage()

func (*DatatypeMeta) ProtoReflect

func (x *DatatypeMeta) ProtoReflect() protoreflect.Message

func (*DatatypeMeta) Reset

func (x *DatatypeMeta) Reset()

func (*DatatypeMeta) String

func (x *DatatypeMeta) String() string

type EncodingMessage

type EncodingMessage struct {
	Type TypeOfDatatype `protobuf:"varint,1,opt,name=type,proto3,enum=orda.TypeOfDatatype" json:"type,omitempty"`
	Op   *Operation     `protobuf:"bytes,2,opt,name=op,proto3" json:"op,omitempty"`
	// contains filtered or unexported fields
}

func (*EncodingMessage) Descriptor deprecated

func (*EncodingMessage) Descriptor() ([]byte, []int)

Deprecated: Use EncodingMessage.ProtoReflect.Descriptor instead.

func (*EncodingMessage) GetOp

func (x *EncodingMessage) GetOp() *Operation

func (*EncodingMessage) GetType

func (x *EncodingMessage) GetType() TypeOfDatatype

func (*EncodingMessage) ProtoMessage

func (*EncodingMessage) ProtoMessage()

func (*EncodingMessage) ProtoReflect

func (x *EncodingMessage) ProtoReflect() protoreflect.Message

func (*EncodingMessage) Reset

func (x *EncodingMessage) Reset()

func (*EncodingMessage) String

func (x *EncodingMessage) String() string
type Header struct {
	Version string      `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
	Agent   string      `protobuf:"bytes,2,opt,name=agent,proto3" json:"agent,omitempty"`
	Type    RequestType `protobuf:"varint,3,opt,name=type,proto3,enum=orda.RequestType" json:"type,omitempty"`
	// contains filtered or unexported fields
}

func NewMessageHeader

func NewMessageHeader(typeOf RequestType) *Header

NewMessageHeader generates a message header.

func (*Header) Descriptor deprecated

func (*Header) Descriptor() ([]byte, []int)

Deprecated: Use Header.ProtoReflect.Descriptor instead.

func (*Header) GetAgent

func (x *Header) GetAgent() string

func (*Header) GetType

func (x *Header) GetType() RequestType

func (*Header) GetVersion

func (x *Header) GetVersion() string

func (*Header) ProtoMessage

func (*Header) ProtoMessage()

func (*Header) ProtoReflect

func (x *Header) ProtoReflect() protoreflect.Message

func (*Header) Reset

func (x *Header) Reset()

func (*Header) String

func (x *Header) String() string

func (*Header) ToString

func (its *Header) ToString() string

ToString returns customized string

type Notification

type Notification struct {
	CUID string `protobuf:"bytes,1,opt,name=CUID,proto3" json:"CUID,omitempty"`
	DUID string `protobuf:"bytes,2,opt,name=DUID,proto3" json:"DUID,omitempty"`
	Sseq uint64 `protobuf:"varint,3,opt,name=sseq,proto3" json:"sseq,omitempty"`
	// contains filtered or unexported fields
}

func (*Notification) Descriptor deprecated

func (*Notification) Descriptor() ([]byte, []int)

Deprecated: Use Notification.ProtoReflect.Descriptor instead.

func (*Notification) GetCUID

func (x *Notification) GetCUID() string

func (*Notification) GetDUID

func (x *Notification) GetDUID() string

func (*Notification) GetSseq

func (x *Notification) GetSseq() uint64

func (*Notification) ProtoMessage

func (*Notification) ProtoMessage()

func (*Notification) ProtoReflect

func (x *Notification) ProtoReflect() protoreflect.Message

func (*Notification) Reset

func (x *Notification) Reset()

func (*Notification) String

func (x *Notification) String() string

type OpList

type OpList []*Operation

OpList is a list of *Operation

func (OpList) ToString

func (its OpList) ToString(isFull bool) string

ToString returns string

type Operation

type Operation struct {
	ID     *OperationID    `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
	OpType TypeOfOperation `protobuf:"varint,2,opt,name=opType,proto3,enum=orda.TypeOfOperation" json:"opType,omitempty"`
	Body   []byte          `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"`
	// contains filtered or unexported fields
}

func (*Operation) Descriptor deprecated

func (*Operation) Descriptor() ([]byte, []int)

Deprecated: Use Operation.ProtoReflect.Descriptor instead.

func (*Operation) GetBody

func (x *Operation) GetBody() []byte

func (*Operation) GetID

func (x *Operation) GetID() *OperationID

func (*Operation) GetOpType

func (x *Operation) GetOpType() TypeOfOperation

func (*Operation) ProtoMessage

func (*Operation) ProtoMessage()

func (*Operation) ProtoReflect

func (x *Operation) ProtoReflect() protoreflect.Message

func (*Operation) Reset

func (x *Operation) Reset()

func (*Operation) String

func (x *Operation) String() string

func (*Operation) ToShortString

func (its *Operation) ToShortString() string

ToShortString returns a string of the operation without its body

func (*Operation) ToString

func (its *Operation) ToString() string

ToString returns a string of the operation with its body.

type OperationID

type OperationID struct {

	// @inject_tag: json:"e,omitempty"
	Era uint32 `protobuf:"varint,1,opt,name=era,proto3" json:"e,omitempty"`
	// @inject_tag: json:"l,omitempty"
	Lamport uint64 `protobuf:"varint,2,opt,name=lamport,proto3" json:"l,omitempty"`
	// @inject_tag: json:"c,omitempty"
	CUID string `protobuf:"bytes,3,opt,name=CUID,proto3" json:"c,omitempty"`
	// @inject_tag: json:"s,omitempty"
	Seq uint64 `protobuf:"varint,4,opt,name=seq,proto3" json:"s,omitempty"`
	// contains filtered or unexported fields
}

func NewOperationID

func NewOperationID() *OperationID

NewOperationID creates a new OperationID.

func NewOperationIDWithCUID

func NewOperationIDWithCUID(cuid string) *OperationID

NewOperationIDWithCUID creates a new OperationID with CUID.

func (*OperationID) Clone

func (its *OperationID) Clone() *OperationID

Clone ...

func (*OperationID) Compare

func (its *OperationID) Compare(other *OperationID) int

Compare compares two operationIDs.

func (*OperationID) Descriptor deprecated

func (*OperationID) Descriptor() ([]byte, []int)

Deprecated: Use OperationID.ProtoReflect.Descriptor instead.

func (*OperationID) GetCUID

func (x *OperationID) GetCUID() string

func (*OperationID) GetEra

func (x *OperationID) GetEra() uint32

func (*OperationID) GetLamport

func (x *OperationID) GetLamport() uint64

func (*OperationID) GetSeq

func (x *OperationID) GetSeq() uint64

func (*OperationID) GetTimestamp

func (its *OperationID) GetTimestamp() *Timestamp

GetTimestamp returns Timestamp from OperationID

func (*OperationID) Next

func (its *OperationID) Next() *OperationID

Next increments an OperationID

func (*OperationID) ProtoMessage

func (*OperationID) ProtoMessage()

func (*OperationID) ProtoReflect

func (x *OperationID) ProtoReflect() protoreflect.Message

func (*OperationID) Reset

func (x *OperationID) Reset()

func (*OperationID) RollBack

func (its *OperationID) RollBack()

RollBack rollbacks the OperationID

func (*OperationID) SetOperationID

func (its *OperationID) SetOperationID(other *OperationID)

SetOperationID sets the values of OperationID.

func (*OperationID) String

func (x *OperationID) String() string

func (*OperationID) SyncLamport

func (its *OperationID) SyncLamport(other uint64) uint64

SyncLamport synchronizes the value of Lamport.

func (*OperationID) ToJSON

func (its *OperationID) ToJSON() interface{}

ToJSON returns an OperationID as JSON

func (*OperationID) ToString

func (its *OperationID) ToString() string

ToString returns customized string

type OrdaServiceClient

type OrdaServiceClient interface {
	ProcessPushPull(ctx context.Context, in *PushPullMessage, opts ...grpc.CallOption) (*PushPullMessage, error)
	ProcessClient(ctx context.Context, in *ClientMessage, opts ...grpc.CallOption) (*ClientMessage, error)
	PatchDocument(ctx context.Context, in *PatchMessage, opts ...grpc.CallOption) (*PatchMessage, error)
	CreateCollection(ctx context.Context, in *CollectionMessage, opts ...grpc.CallOption) (*CollectionMessage, error)
	ResetCollection(ctx context.Context, in *CollectionMessage, opts ...grpc.CallOption) (*CollectionMessage, error)
	TestEncodingOperation(ctx context.Context, in *EncodingMessage, opts ...grpc.CallOption) (*EncodingMessage, error)
}

OrdaServiceClient is the client API for OrdaService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type OrdaServiceServer

type OrdaServiceServer interface {
	ProcessPushPull(context.Context, *PushPullMessage) (*PushPullMessage, error)
	ProcessClient(context.Context, *ClientMessage) (*ClientMessage, error)
	PatchDocument(context.Context, *PatchMessage) (*PatchMessage, error)
	CreateCollection(context.Context, *CollectionMessage) (*CollectionMessage, error)
	ResetCollection(context.Context, *CollectionMessage) (*CollectionMessage, error)
	TestEncodingOperation(context.Context, *EncodingMessage) (*EncodingMessage, error)
}

OrdaServiceServer is the server API for OrdaService service.

type PatchMessage

type PatchMessage struct {
	Key        string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Collection string `protobuf:"bytes,2,opt,name=collection,proto3" json:"collection,omitempty"`
	Json       string `protobuf:"bytes,3,opt,name=json,proto3" json:"json,omitempty"`
	// contains filtered or unexported fields
}

func (*PatchMessage) Descriptor deprecated

func (*PatchMessage) Descriptor() ([]byte, []int)

Deprecated: Use PatchMessage.ProtoReflect.Descriptor instead.

func (*PatchMessage) GetCollection

func (x *PatchMessage) GetCollection() string

func (*PatchMessage) GetJson

func (x *PatchMessage) GetJson() string

func (*PatchMessage) GetKey

func (x *PatchMessage) GetKey() string

func (*PatchMessage) ProtoMessage

func (*PatchMessage) ProtoMessage()

func (*PatchMessage) ProtoReflect

func (x *PatchMessage) ProtoReflect() protoreflect.Message

func (*PatchMessage) Reset

func (x *PatchMessage) Reset()

func (*PatchMessage) String

func (x *PatchMessage) String() string

type PushPullMessage

type PushPullMessage struct {
	Header        *Header         `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
	Collection    string          `protobuf:"bytes,2,opt,name=collection,proto3" json:"collection,omitempty"`
	Cuid          string          `protobuf:"bytes,3,opt,name=cuid,proto3" json:"cuid,omitempty"`
	PushPullPacks []*PushPullPack `protobuf:"bytes,4,rep,name=PushPullPacks,proto3" json:"PushPullPacks,omitempty"`
	// contains filtered or unexported fields
}

func NewPushPullMessage

func NewPushPullMessage(seq uint32, client *Client, pushPullPackList ...*PushPullPack) *PushPullMessage

NewPushPullMessage creates a new PushPullRequest

func (*PushPullMessage) Descriptor deprecated

func (*PushPullMessage) Descriptor() ([]byte, []int)

Deprecated: Use PushPullMessage.ProtoReflect.Descriptor instead.

func (*PushPullMessage) GetClient

func (its *PushPullMessage) GetClient() *Client

GetClient returns the model of the client

func (*PushPullMessage) GetCollection

func (x *PushPullMessage) GetCollection() string

func (*PushPullMessage) GetCuid

func (x *PushPullMessage) GetCuid() string

func (*PushPullMessage) GetHeader

func (x *PushPullMessage) GetHeader() *Header

func (*PushPullMessage) GetPushPullPacks

func (x *PushPullMessage) GetPushPullPacks() []*PushPullPack

func (*PushPullMessage) ProtoMessage

func (*PushPullMessage) ProtoMessage()

func (*PushPullMessage) ProtoReflect

func (x *PushPullMessage) ProtoReflect() protoreflect.Message

func (*PushPullMessage) Reset

func (x *PushPullMessage) Reset()

func (*PushPullMessage) String

func (x *PushPullMessage) String() string

func (*PushPullMessage) ToString

func (its *PushPullMessage) ToString(isFull bool) string

ToString returns customized string

type PushPullPack

type PushPullPack struct {
	DUID       string         `protobuf:"bytes,1,opt,name=DUID,proto3" json:"DUID,omitempty"`
	Key        string         `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	Option     uint32         `protobuf:"fixed32,3,opt,name=option,proto3" json:"option,omitempty"`
	CheckPoint *CheckPoint    `protobuf:"bytes,4,opt,name=checkPoint,proto3" json:"checkPoint,omitempty"`
	Era        uint32         `protobuf:"varint,5,opt,name=era,proto3" json:"era,omitempty"`
	Type       TypeOfDatatype `protobuf:"varint,6,opt,name=type,proto3,enum=orda.TypeOfDatatype" json:"type,omitempty"`
	Operations []*Operation   `protobuf:"bytes,7,rep,name=operations,proto3" json:"operations,omitempty"`
	// contains filtered or unexported fields
}

func (*PushPullPack) Descriptor deprecated

func (*PushPullPack) Descriptor() ([]byte, []int)

Deprecated: Use PushPullPack.ProtoReflect.Descriptor instead.

func (*PushPullPack) GetCheckPoint

func (x *PushPullPack) GetCheckPoint() *CheckPoint

func (*PushPullPack) GetDUID

func (x *PushPullPack) GetDUID() string

func (*PushPullPack) GetDatatypeTag

func (its *PushPullPack) GetDatatypeTag() string

GetDatatypeTag returns datatype tag

func (*PushPullPack) GetEra

func (x *PushPullPack) GetEra() uint32

func (*PushPullPack) GetKey

func (x *PushPullPack) GetKey() string

func (*PushPullPack) GetOperations

func (x *PushPullPack) GetOperations() []*Operation

func (*PushPullPack) GetOption

func (x *PushPullPack) GetOption() uint32

func (*PushPullPack) GetPushPullPackOption

func (its *PushPullPack) GetPushPullPackOption() *PushPullPackOption

GetPushPullPackOption returns PushPullOption.

func (*PushPullPack) GetResponsePushPullPack

func (its *PushPullPack) GetResponsePushPullPack() *PushPullPack

GetResponsePushPullPack returns the PushPullPack that can be used for response.

func (*PushPullPack) GetType

func (x *PushPullPack) GetType() TypeOfDatatype

func (*PushPullPack) ProtoMessage

func (*PushPullPack) ProtoMessage()

func (*PushPullPack) ProtoReflect

func (x *PushPullPack) ProtoReflect() protoreflect.Message

func (*PushPullPack) Reset

func (x *PushPullPack) Reset()

func (*PushPullPack) String

func (x *PushPullPack) String() string

func (*PushPullPack) ToString

func (its *PushPullPack) ToString(isFull bool) string

ToString returns customized string.

type PushPullPackOption

type PushPullPackOption uint32

PushPullPackOption denotes an option implied in a PushPullPack.

const (
	PushPullBitNormal      PushPullPackOption = 0x00
	PushPullBitCreate      PushPullPackOption = 0x01
	PushPullBitSubscribe   PushPullPackOption = 0x02
	PushPullBitUnsubscribe PushPullPackOption = 0x04
	PushPullBitDelete      PushPullPackOption = 0x08
	PushPullBitSnapshot    PushPullPackOption = 0x10
	PushPullBitError       PushPullPackOption = 0x20
	PushPullBitReadOnly    PushPullPackOption = 0x40
)

PushPullBitXXX denotes a bit for the option for PushPull

func (*PushPullPackOption) HasCreateBit

func (its *PushPullPackOption) HasCreateBit() bool

HasCreateBit examines CreateBit.

func (*PushPullPackOption) HasDeleteBit

func (its *PushPullPackOption) HasDeleteBit() bool

HasDeleteBit examines DeleteBit.

func (*PushPullPackOption) HasErrorBit

func (its *PushPullPackOption) HasErrorBit() bool

HasErrorBit examines ErrorBit.

func (*PushPullPackOption) HasReadOnly

func (its *PushPullPackOption) HasReadOnly() bool

HasReadOnly examines ReadOnlyBit.

func (*PushPullPackOption) HasSnapshotBit

func (its *PushPullPackOption) HasSnapshotBit() bool

HasSnapshotBit examines SnapshotBit.

func (*PushPullPackOption) HasSubscribeBit

func (its *PushPullPackOption) HasSubscribeBit() bool

HasSubscribeBit examines SubscribeBit.

func (*PushPullPackOption) HasUnsubscribeBit

func (its *PushPullPackOption) HasUnsubscribeBit() bool

HasUnsubscribeBit examines UnsubscribeBit.

func (*PushPullPackOption) SetCreateBit

func (its *PushPullPackOption) SetCreateBit() *PushPullPackOption

SetCreateBit sets CreateBit.

func (*PushPullPackOption) SetDeleteBit

func (its *PushPullPackOption) SetDeleteBit() *PushPullPackOption

SetDeleteBit sets DeleteBit.

func (*PushPullPackOption) SetErrorBit

func (its *PushPullPackOption) SetErrorBit() *PushPullPackOption

SetErrorBit sets ErrorBit.

func (*PushPullPackOption) SetReadOnlyBit

func (its *PushPullPackOption) SetReadOnlyBit() *PushPullPackOption

SetReadOnlyBit sets ReadOnlyBit

func (*PushPullPackOption) SetSnapshotBit

func (its *PushPullPackOption) SetSnapshotBit() *PushPullPackOption

SetSnapshotBit sets SnapshotBit.

func (*PushPullPackOption) SetSubscribeBit

func (its *PushPullPackOption) SetSubscribeBit() *PushPullPackOption

SetSubscribeBit sets SubscribeBit.

func (*PushPullPackOption) SetUnsubscribeBit

func (its *PushPullPackOption) SetUnsubscribeBit() *PushPullPackOption

SetUnsubscribeBit sets UnsubscribeBit.

func (*PushPullPackOption) String

func (its *PushPullPackOption) String() string

type RequestType

type RequestType int32
const (
	RequestType_CLIENTS   RequestType = 0
	RequestType_PUSHPULLS RequestType = 1
)

func (RequestType) Descriptor

func (RequestType) Enum

func (x RequestType) Enum() *RequestType

func (RequestType) EnumDescriptor deprecated

func (RequestType) EnumDescriptor() ([]byte, []int)

Deprecated: Use RequestType.Descriptor instead.

func (RequestType) Number

func (x RequestType) Number() protoreflect.EnumNumber

func (RequestType) String

func (x RequestType) String() string

func (RequestType) Type

type StateOfDatatype

type StateOfDatatype int32
const (
	StateOfDatatype_DUE_TO_CREATE           StateOfDatatype = 0
	StateOfDatatype_DUE_TO_SUBSCRIBE        StateOfDatatype = 1
	StateOfDatatype_DUE_TO_SUBSCRIBE_CREATE StateOfDatatype = 2
	StateOfDatatype_SUBSCRIBED              StateOfDatatype = 3
	StateOfDatatype_DUE_TO_UNSUBSCRIBE      StateOfDatatype = 4
	StateOfDatatype_CLOSED                  StateOfDatatype = 5
	StateOfDatatype_DELETED                 StateOfDatatype = 6
)

func (StateOfDatatype) Descriptor

func (StateOfDatatype) Enum

func (x StateOfDatatype) Enum() *StateOfDatatype

func (StateOfDatatype) EnumDescriptor deprecated

func (StateOfDatatype) EnumDescriptor() ([]byte, []int)

Deprecated: Use StateOfDatatype.Descriptor instead.

func (StateOfDatatype) Number

func (StateOfDatatype) String

func (x StateOfDatatype) String() string

func (StateOfDatatype) Type

type StateOfResponse

type StateOfResponse int32
const (
	StateOfResponse_OK                            StateOfResponse = 0
	StateOfResponse_ERR_CLIENT_INVALID_COLLECTION StateOfResponse = 101
	StateOfResponse_ERR_CLIENT_INVALID_SYNC_TYPE  StateOfResponse = 102
)

func (StateOfResponse) Descriptor

func (StateOfResponse) Enum

func (x StateOfResponse) Enum() *StateOfResponse

func (StateOfResponse) EnumDescriptor deprecated

func (StateOfResponse) EnumDescriptor() ([]byte, []int)

Deprecated: Use StateOfResponse.Descriptor instead.

func (StateOfResponse) Number

func (StateOfResponse) String

func (x StateOfResponse) String() string

func (StateOfResponse) Type

type SyncType

type SyncType int32
const (
	SyncType_LOCAL_ONLY SyncType = 0
	SyncType_MANUALLY   SyncType = 1
	SyncType_REALTIME   SyncType = 2
)

func (SyncType) Descriptor

func (SyncType) Descriptor() protoreflect.EnumDescriptor

func (SyncType) Enum

func (x SyncType) Enum() *SyncType

func (SyncType) EnumDescriptor deprecated

func (SyncType) EnumDescriptor() ([]byte, []int)

Deprecated: Use SyncType.Descriptor instead.

func (SyncType) Number

func (x SyncType) Number() protoreflect.EnumNumber

func (SyncType) String

func (x SyncType) String() string

func (SyncType) Type

type Timestamp

type Timestamp struct {

	// @inject_tag: json:"e,omitempty"
	Era uint32 `protobuf:"varint,1,opt,name=era,proto3" json:"e,omitempty"`
	// @inject_tag: json:"l,omitempty"
	Lamport uint64 `protobuf:"varint,2,opt,name=lamport,proto3" json:"l,omitempty"`
	// @inject_tag: json:"c,omitempty"
	CUID string `protobuf:"bytes,3,opt,name=CUID,proto3" json:"c,omitempty"`
	// @inject_tag: json:"d,omitempty"
	Delimiter uint32 `protobuf:"varint,4,opt,name=delimiter,proto3" json:"d,omitempty"`
	// contains filtered or unexported fields
}

func NewTimestamp

func NewTimestamp(era uint32, lamport uint64, cuid string, delimiter uint32) *Timestamp

NewTimestamp creates a new timestamp

func OldestTimestamp

func OldestTimestamp() *Timestamp

OldestTimestamp returns the oldest timestamp.

func (*Timestamp) Clone

func (its *Timestamp) Clone() *Timestamp

Clone returns clone of this Timestamp.

func (*Timestamp) Compare

func (its *Timestamp) Compare(o *Timestamp) int

Compare is used to compared with another Timestamp.

func (*Timestamp) Descriptor deprecated

func (*Timestamp) Descriptor() ([]byte, []int)

Deprecated: Use Timestamp.ProtoReflect.Descriptor instead.

func (*Timestamp) GetAndNextDelimiter

func (its *Timestamp) GetAndNextDelimiter() *Timestamp

GetAndNextDelimiter returns a next Timestamp having increased deliminator.

func (*Timestamp) GetCUID

func (x *Timestamp) GetCUID() string

func (*Timestamp) GetDelimiter

func (x *Timestamp) GetDelimiter() uint32

func (*Timestamp) GetEra

func (x *Timestamp) GetEra() uint32

func (*Timestamp) GetLamport

func (x *Timestamp) GetLamport() uint64

func (*Timestamp) Hash

func (its *Timestamp) Hash() string

Hash returns the string hash of timestamp. DON'T change this because protocol can be broken : TODO: this can be improved.

func (*Timestamp) Next

func (its *Timestamp) Next() *Timestamp

Next returns a next Timestamp having increased Lamport.

func (*Timestamp) ProtoMessage

func (*Timestamp) ProtoMessage()

func (*Timestamp) ProtoReflect

func (x *Timestamp) ProtoReflect() protoreflect.Message

func (*Timestamp) Reset

func (x *Timestamp) Reset()

func (*Timestamp) String

func (x *Timestamp) String() string

func (*Timestamp) ToString

func (its *Timestamp) ToString() string

ToString is used to get string for Timestamp

type TypeOfDatatype

type TypeOfDatatype int32
const (
	TypeOfDatatype_COUNTER  TypeOfDatatype = 0
	TypeOfDatatype_MAP      TypeOfDatatype = 1
	TypeOfDatatype_LIST     TypeOfDatatype = 2
	TypeOfDatatype_DOCUMENT TypeOfDatatype = 3
)

func (TypeOfDatatype) Descriptor

func (TypeOfDatatype) Enum

func (x TypeOfDatatype) Enum() *TypeOfDatatype

func (TypeOfDatatype) EnumDescriptor deprecated

func (TypeOfDatatype) EnumDescriptor() ([]byte, []int)

Deprecated: Use TypeOfDatatype.Descriptor instead.

func (TypeOfDatatype) Number

func (TypeOfDatatype) String

func (x TypeOfDatatype) String() string

func (TypeOfDatatype) Type

type TypeOfOperation

type TypeOfOperation int32
const (
	TypeOfOperation_NO_OP            TypeOfOperation = 0
	TypeOfOperation_ERROR            TypeOfOperation = 1
	TypeOfOperation_TRANSACTION      TypeOfOperation = 2
	TypeOfOperation_COUNTER_SNAPSHOT TypeOfOperation = 10
	TypeOfOperation_COUNTER_INCREASE TypeOfOperation = 11
	TypeOfOperation_MAP_SNAPSHOT     TypeOfOperation = 20
	TypeOfOperation_MAP_PUT          TypeOfOperation = 21
	TypeOfOperation_MAP_REMOVE       TypeOfOperation = 22
	TypeOfOperation_LIST_SNAPSHOT    TypeOfOperation = 30
	TypeOfOperation_LIST_INSERT      TypeOfOperation = 31
	TypeOfOperation_LIST_DELETE      TypeOfOperation = 32
	TypeOfOperation_LIST_UPDATE      TypeOfOperation = 33
	TypeOfOperation_DOC_SNAPSHOT     TypeOfOperation = 40
	TypeOfOperation_DOC_OBJ_PUT      TypeOfOperation = 41
	TypeOfOperation_DOC_OBJ_RMV      TypeOfOperation = 42
	TypeOfOperation_DOC_ARR_INS      TypeOfOperation = 43
	TypeOfOperation_DOC_ARR_DEL      TypeOfOperation = 44
	TypeOfOperation_DOC_ARR_UPD      TypeOfOperation = 45
)

func (TypeOfOperation) Descriptor

func (TypeOfOperation) Enum

func (x TypeOfOperation) Enum() *TypeOfOperation

func (TypeOfOperation) EnumDescriptor deprecated

func (TypeOfOperation) EnumDescriptor() ([]byte, []int)

Deprecated: Use TypeOfOperation.Descriptor instead.

func (TypeOfOperation) Number

func (TypeOfOperation) String

func (x TypeOfOperation) String() string

func (TypeOfOperation) Type

type UnimplementedOrdaServiceServer

type UnimplementedOrdaServiceServer struct {
}

UnimplementedOrdaServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedOrdaServiceServer) CreateCollection

func (*UnimplementedOrdaServiceServer) PatchDocument

func (*UnimplementedOrdaServiceServer) ProcessClient

func (*UnimplementedOrdaServiceServer) ProcessPushPull

func (*UnimplementedOrdaServiceServer) ResetCollection

func (*UnimplementedOrdaServiceServer) TestEncodingOperation

Jump to

Keyboard shortcuts

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