msg

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package msg contains: - the definition of PROTOBUF structures and gRPC service, - helpers for mapping between PROTOBUF structures & the datasync_api.go.

Index

Constants

This section is empty.

Variables

View Source
var (
	PutDel_name = map[int32]string{
		0: "PUT",
		1: "DEL",
	}
	PutDel_value = map[string]int32{
		"PUT": 0,
		"DEL": 1,
	}
)

Enum value maps for PutDel.

View Source
var File_datamsg_proto protoreflect.FileDescriptor

Functions

func RegisterDataMsgServiceServer

func RegisterDataMsgServiceServer(s *grpc.Server, srv DataMsgServiceServer)

Types

type ChangeEvent

type ChangeEvent struct {
	// contains filtered or unexported fields
}

ChangeEvent represents change event with changes.

func NewChangeWatchResp

func NewChangeWatchResp(ctx context.Context, message *DataChangeRequest, callback func(error)) *ChangeEvent

NewChangeWatchResp is a constructor.

func (*ChangeEvent) Done

func (ev *ChangeEvent) Done(err error)

Done does nothing yet.

func (*ChangeEvent) GetChanges

func (ev *ChangeEvent) GetChanges() []datasync.ProtoWatchResp

GetChanges returns list of changes for the change event.

func (*ChangeEvent) GetContext

func (ev *ChangeEvent) GetContext() context.Context

GetContext returns the context associated with the event.

type ChangeWatchResp

type ChangeWatchResp struct {
	// contains filtered or unexported fields
}

ChangeWatchResp adapts Datamessage to interface datasync.ChangeEvent.

func (*ChangeWatchResp) GetChangeType

func (ev *ChangeWatchResp) GetChangeType() datasync.Op

GetChangeType - see the comment in implemented interface datasync.ChangeEvent.

func (*ChangeWatchResp) GetKey

func (ev *ChangeWatchResp) GetKey() string

GetKey returns the key associated with the change.

func (*ChangeWatchResp) GetPrevValue

func (ev *ChangeWatchResp) GetPrevValue(prevVal proto.Message) (prevExists bool, err error)

GetPrevValue returns the value before change.

func (*ChangeWatchResp) GetRevision

func (ev *ChangeWatchResp) GetRevision() int64

GetRevision //TODO

func (*ChangeWatchResp) GetValue

func (ev *ChangeWatchResp) GetValue(val proto.Message) error

GetValue - see the comments in the interface datasync.ChangeEvent.

type DataChangeReply

type DataChangeReply struct {
	Key           string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	OperationType PutDel `protobuf:"varint,3,opt,name=operationType,proto3,enum=msg.PutDel" json:"operationType,omitempty"`
	// zero means success
	Result uint32 `protobuf:"varint,4,opt,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*DataChangeReply) Descriptor deprecated

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

Deprecated: Use DataChangeReply.ProtoReflect.Descriptor instead.

func (*DataChangeReply) GetKey

func (x *DataChangeReply) GetKey() string

func (*DataChangeReply) GetOperationType

func (x *DataChangeReply) GetOperationType() PutDel

func (*DataChangeReply) GetResult

func (x *DataChangeReply) GetResult() uint32

func (*DataChangeReply) ProtoMessage

func (*DataChangeReply) ProtoMessage()

func (*DataChangeReply) ProtoReflect

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

func (*DataChangeReply) Reset

func (x *DataChangeReply) Reset()

func (*DataChangeReply) String

func (x *DataChangeReply) String() string

type DataChangeRequest

type DataChangeRequest struct {
	Key           string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	OperationType PutDel `protobuf:"varint,2,opt,name=operationType,proto3,enum=msg.PutDel" json:"operationType,omitempty"`
	Content       []byte `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"`
	ContentType   string `protobuf:"bytes,4,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"`
	// contains filtered or unexported fields
}

func (*DataChangeRequest) Descriptor deprecated

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

Deprecated: Use DataChangeRequest.ProtoReflect.Descriptor instead.

func (*DataChangeRequest) GetContent

func (x *DataChangeRequest) GetContent() []byte

func (*DataChangeRequest) GetContentType

func (x *DataChangeRequest) GetContentType() string

func (*DataChangeRequest) GetKey

func (x *DataChangeRequest) GetKey() string

func (*DataChangeRequest) GetOperationType

func (x *DataChangeRequest) GetOperationType() PutDel

func (*DataChangeRequest) ProtoMessage

func (*DataChangeRequest) ProtoMessage()

func (*DataChangeRequest) ProtoReflect

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

func (*DataChangeRequest) Reset

func (x *DataChangeRequest) Reset()

func (*DataChangeRequest) String

func (x *DataChangeRequest) String() string

type DataMsgReply

type DataMsgReply struct {
	MsgId       *Seq                             `protobuf:"bytes,1,opt,name=msgId,proto3" json:"msgId,omitempty"`
	Error       *Error                           `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
	DataChanges *DataMsgReply_DataChangesReplies `protobuf:"bytes,3,opt,name=dataChanges,proto3" json:"dataChanges,omitempty"`
	DataResyncs *DataMsgReply_DataResyncsReplies `protobuf:"bytes,4,opt,name=dataResyncs,proto3" json:"dataResyncs,omitempty"`
	// contains filtered or unexported fields
}

func (*DataMsgReply) Descriptor deprecated

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

Deprecated: Use DataMsgReply.ProtoReflect.Descriptor instead.

func (*DataMsgReply) GetDataChanges

func (x *DataMsgReply) GetDataChanges() *DataMsgReply_DataChangesReplies

func (*DataMsgReply) GetDataResyncs

func (x *DataMsgReply) GetDataResyncs() *DataMsgReply_DataResyncsReplies

func (*DataMsgReply) GetError

func (x *DataMsgReply) GetError() *Error

func (*DataMsgReply) GetMsgId

func (x *DataMsgReply) GetMsgId() *Seq

func (*DataMsgReply) ProtoMessage

func (*DataMsgReply) ProtoMessage()

func (*DataMsgReply) ProtoReflect

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

func (*DataMsgReply) Reset

func (x *DataMsgReply) Reset()

func (*DataMsgReply) String

func (x *DataMsgReply) String() string

type DataMsgReply_DataChangesReplies

type DataMsgReply_DataChangesReplies struct {
	Replies []*DataChangeReply `protobuf:"bytes,1,rep,name=replies,proto3" json:"replies,omitempty"`
	// contains filtered or unexported fields
}

func (*DataMsgReply_DataChangesReplies) Descriptor deprecated

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

Deprecated: Use DataMsgReply_DataChangesReplies.ProtoReflect.Descriptor instead.

func (*DataMsgReply_DataChangesReplies) GetReplies

func (*DataMsgReply_DataChangesReplies) ProtoMessage

func (*DataMsgReply_DataChangesReplies) ProtoMessage()

func (*DataMsgReply_DataChangesReplies) ProtoReflect

func (*DataMsgReply_DataChangesReplies) Reset

func (*DataMsgReply_DataChangesReplies) String

type DataMsgReply_DataResyncsReplies

type DataMsgReply_DataResyncsReplies struct {
	Replies []*DataResyncReply `protobuf:"bytes,1,rep,name=replies,proto3" json:"replies,omitempty"`
	// contains filtered or unexported fields
}

func (*DataMsgReply_DataResyncsReplies) Descriptor deprecated

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

Deprecated: Use DataMsgReply_DataResyncsReplies.ProtoReflect.Descriptor instead.

func (*DataMsgReply_DataResyncsReplies) GetReplies

func (*DataMsgReply_DataResyncsReplies) ProtoMessage

func (*DataMsgReply_DataResyncsReplies) ProtoMessage()

func (*DataMsgReply_DataResyncsReplies) ProtoReflect

func (*DataMsgReply_DataResyncsReplies) Reset

func (*DataMsgReply_DataResyncsReplies) String

type DataMsgRequest

type DataMsgRequest struct {
	MsgId       *Seq                 `protobuf:"bytes,1,opt,name=msgId,proto3" json:"msgId,omitempty"`
	Txn         *Seq                 `protobuf:"bytes,2,opt,name=txn,proto3" json:"txn,omitempty"` //TODO remove this
	DataChanges []*DataChangeRequest `protobuf:"bytes,3,rep,name=dataChanges,proto3" json:"dataChanges,omitempty"`
	DataResyncs []*DataResyncRequest `protobuf:"bytes,4,rep,name=dataResyncs,proto3" json:"dataResyncs,omitempty"` //use max 1
	// contains filtered or unexported fields
}

func (*DataMsgRequest) Descriptor deprecated

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

Deprecated: Use DataMsgRequest.ProtoReflect.Descriptor instead.

func (*DataMsgRequest) GetDataChanges

func (x *DataMsgRequest) GetDataChanges() []*DataChangeRequest

func (*DataMsgRequest) GetDataResyncs

func (x *DataMsgRequest) GetDataResyncs() []*DataResyncRequest

func (*DataMsgRequest) GetMsgId

func (x *DataMsgRequest) GetMsgId() *Seq

func (*DataMsgRequest) GetTxn

func (x *DataMsgRequest) GetTxn() *Seq

func (*DataMsgRequest) ProtoMessage

func (*DataMsgRequest) ProtoMessage()

func (*DataMsgRequest) ProtoReflect

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

func (*DataMsgRequest) Reset

func (x *DataMsgRequest) Reset()

func (*DataMsgRequest) String

func (x *DataMsgRequest) String() string

type DataMsgServiceClient

type DataMsgServiceClient interface {
	DataChanges(ctx context.Context, opts ...grpc.CallOption) (DataMsgService_DataChangesClient, error)
	DataResyncs(ctx context.Context, in *DataResyncRequests, opts ...grpc.CallOption) (*DataResyncReplies, error)
	Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingReply, error)
}

DataMsgServiceClient is the client API for DataMsgService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type DataMsgServiceServer

type DataMsgServiceServer interface {
	DataChanges(DataMsgService_DataChangesServer) error
	DataResyncs(context.Context, *DataResyncRequests) (*DataResyncReplies, error)
	Ping(context.Context, *PingRequest) (*PingReply, error)
	// contains filtered or unexported methods
}

DataMsgServiceServer is the server API for DataMsgService service. All implementations must embed UnimplementedDataMsgServiceServer for forward compatibility

type DataMsgService_DataChangesClient

type DataMsgService_DataChangesClient interface {
	Send(*DataChangeRequest) error
	Recv() (*DataChangeReply, error)
	grpc.ClientStream
}

type DataMsgService_DataChangesServer

type DataMsgService_DataChangesServer interface {
	Send(*DataChangeReply) error
	Recv() (*DataChangeRequest, error)
	grpc.ServerStream
}

type DataResyncReplies

type DataResyncReplies struct {
	MsgId       *Seq                                  `protobuf:"bytes,1,opt,name=msgId,proto3" json:"msgId,omitempty"`
	Error       *Error                                `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
	DataResyncs *DataResyncReplies_DataResyncsReplies `protobuf:"bytes,3,opt,name=dataResyncs,proto3" json:"dataResyncs,omitempty"`
	// contains filtered or unexported fields
}

func (*DataResyncReplies) Descriptor deprecated

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

Deprecated: Use DataResyncReplies.ProtoReflect.Descriptor instead.

func (*DataResyncReplies) GetDataResyncs

func (*DataResyncReplies) GetError

func (x *DataResyncReplies) GetError() *Error

func (*DataResyncReplies) GetMsgId

func (x *DataResyncReplies) GetMsgId() *Seq

func (*DataResyncReplies) ProtoMessage

func (*DataResyncReplies) ProtoMessage()

func (*DataResyncReplies) ProtoReflect

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

func (*DataResyncReplies) Reset

func (x *DataResyncReplies) Reset()

func (*DataResyncReplies) String

func (x *DataResyncReplies) String() string

type DataResyncReplies_DataResyncsReplies

type DataResyncReplies_DataResyncsReplies struct {
	Replies []*DataResyncReply `protobuf:"bytes,1,rep,name=replies,proto3" json:"replies,omitempty"`
	// contains filtered or unexported fields
}

func (*DataResyncReplies_DataResyncsReplies) Descriptor deprecated

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

Deprecated: Use DataResyncReplies_DataResyncsReplies.ProtoReflect.Descriptor instead.

func (*DataResyncReplies_DataResyncsReplies) GetReplies

func (*DataResyncReplies_DataResyncsReplies) ProtoMessage

func (*DataResyncReplies_DataResyncsReplies) ProtoMessage()

func (*DataResyncReplies_DataResyncsReplies) ProtoReflect

func (*DataResyncReplies_DataResyncsReplies) Reset

func (*DataResyncReplies_DataResyncsReplies) String

type DataResyncReply

type DataResyncReply struct {
	ResyncId *Seq   `protobuf:"bytes,1,opt,name=resyncId,proto3" json:"resyncId,omitempty"`
	Key      string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	// zero means success
	Result uint32 `protobuf:"varint,3,opt,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*DataResyncReply) Descriptor deprecated

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

Deprecated: Use DataResyncReply.ProtoReflect.Descriptor instead.

func (*DataResyncReply) GetKey

func (x *DataResyncReply) GetKey() string

func (*DataResyncReply) GetResult

func (x *DataResyncReply) GetResult() uint32

func (*DataResyncReply) GetResyncId

func (x *DataResyncReply) GetResyncId() *Seq

func (*DataResyncReply) ProtoMessage

func (*DataResyncReply) ProtoMessage()

func (*DataResyncReply) ProtoReflect

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

func (*DataResyncReply) Reset

func (x *DataResyncReply) Reset()

func (*DataResyncReply) String

func (x *DataResyncReply) String() string

type DataResyncRequest

type DataResyncRequest struct {
	Key         string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Content     []byte `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
	ContentType string `protobuf:"bytes,3,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"`
	// contains filtered or unexported fields
}

func (*DataResyncRequest) Descriptor deprecated

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

Deprecated: Use DataResyncRequest.ProtoReflect.Descriptor instead.

func (*DataResyncRequest) GetContent

func (x *DataResyncRequest) GetContent() []byte

func (*DataResyncRequest) GetContentType

func (x *DataResyncRequest) GetContentType() string

func (*DataResyncRequest) GetKey

func (x *DataResyncRequest) GetKey() string

func (*DataResyncRequest) ProtoMessage

func (*DataResyncRequest) ProtoMessage()

func (*DataResyncRequest) ProtoReflect

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

func (*DataResyncRequest) Reset

func (x *DataResyncRequest) Reset()

func (*DataResyncRequest) String

func (x *DataResyncRequest) String() string

type DataResyncRequests

type DataResyncRequests struct {
	MsgId       *Seq                 `protobuf:"bytes,1,opt,name=msgId,proto3" json:"msgId,omitempty"`
	DataResyncs []*DataResyncRequest `protobuf:"bytes,2,rep,name=dataResyncs,proto3" json:"dataResyncs,omitempty"`
	// contains filtered or unexported fields
}

func (*DataResyncRequests) Descriptor deprecated

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

Deprecated: Use DataResyncRequests.ProtoReflect.Descriptor instead.

func (*DataResyncRequests) GetDataResyncs

func (x *DataResyncRequests) GetDataResyncs() []*DataResyncRequest

func (*DataResyncRequests) GetMsgId

func (x *DataResyncRequests) GetMsgId() *Seq

func (*DataResyncRequests) ProtoMessage

func (*DataResyncRequests) ProtoMessage()

func (*DataResyncRequests) ProtoReflect

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

func (*DataResyncRequests) Reset

func (x *DataResyncRequests) Reset()

func (*DataResyncRequests) String

func (x *DataResyncRequests) String() string

type Error

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

func (*Error) Descriptor deprecated

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

Deprecated: Use Error.ProtoReflect.Descriptor instead.

func (*Error) GetMessage

func (x *Error) GetMessage() string

func (*Error) ProtoMessage

func (*Error) ProtoMessage()

func (*Error) ProtoReflect

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

func (*Error) Reset

func (x *Error) Reset()

func (*Error) String

func (x *Error) String() string

type PingReply

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

func (*PingReply) Descriptor deprecated

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

Deprecated: Use PingReply.ProtoReflect.Descriptor instead.

func (*PingReply) GetMessage

func (x *PingReply) GetMessage() string

func (*PingReply) ProtoMessage

func (*PingReply) ProtoMessage()

func (*PingReply) ProtoReflect

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

func (*PingReply) Reset

func (x *PingReply) Reset()

func (*PingReply) String

func (x *PingReply) String() string

type PingRequest

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

func (*PingRequest) Descriptor deprecated

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

Deprecated: Use PingRequest.ProtoReflect.Descriptor instead.

func (*PingRequest) GetMessage

func (x *PingRequest) GetMessage() string

func (*PingRequest) ProtoMessage

func (*PingRequest) ProtoMessage()

func (*PingRequest) ProtoReflect

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

func (*PingRequest) Reset

func (x *PingRequest) Reset()

func (*PingRequest) String

func (x *PingRequest) String() string

type PutDel

type PutDel int32
const (
	PutDel_PUT PutDel = 0
	PutDel_DEL PutDel = 1
)

func (PutDel) Descriptor

func (PutDel) Descriptor() protoreflect.EnumDescriptor

func (PutDel) Enum

func (x PutDel) Enum() *PutDel

func (PutDel) EnumDescriptor deprecated

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

Deprecated: Use PutDel.Descriptor instead.

func (PutDel) Number

func (x PutDel) Number() protoreflect.EnumNumber

func (PutDel) String

func (x PutDel) String() string

func (PutDel) Type

func (PutDel) Type() protoreflect.EnumType

type ResyncNeededCallback

type ResyncNeededCallback struct {
	MsgId *Seq `protobuf:"bytes,1,opt,name=msgId,proto3" json:"msgId,omitempty"`
	// Optional
	Error *Error `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
	// contains filtered or unexported fields
}

func (*ResyncNeededCallback) Descriptor deprecated

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

Deprecated: Use ResyncNeededCallback.ProtoReflect.Descriptor instead.

func (*ResyncNeededCallback) GetError

func (x *ResyncNeededCallback) GetError() *Error

func (*ResyncNeededCallback) GetMsgId

func (x *ResyncNeededCallback) GetMsgId() *Seq

func (*ResyncNeededCallback) ProtoMessage

func (*ResyncNeededCallback) ProtoMessage()

func (*ResyncNeededCallback) ProtoReflect

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

func (*ResyncNeededCallback) Reset

func (x *ResyncNeededCallback) Reset()

func (*ResyncNeededCallback) String

func (x *ResyncNeededCallback) String() string

type Seq

type Seq struct {

	// The server that generates this seq
	Originator string `protobuf:"bytes,1,opt,name=originator,proto3" json:"originator,omitempty"`
	// UNIX Timestamp of seqence restart
	// google.protobuf.Timestamp seqCreated = 2;
	SeqCreatedSec int64 `protobuf:"varint,2,opt,name=seqCreatedSec,proto3" json:"seqCreatedSec,omitempty"`
	// Sequence
	Seq uint32 `protobuf:"varint,4,opt,name=seq,proto3" json:"seq,omitempty"`
	// contains filtered or unexported fields
}

func (*Seq) Descriptor deprecated

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

Deprecated: Use Seq.ProtoReflect.Descriptor instead.

func (*Seq) GetOriginator

func (x *Seq) GetOriginator() string

func (*Seq) GetSeq

func (x *Seq) GetSeq() uint32

func (*Seq) GetSeqCreatedSec

func (x *Seq) GetSeqCreatedSec() int64

func (*Seq) ProtoMessage

func (*Seq) ProtoMessage()

func (*Seq) ProtoReflect

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

func (*Seq) Reset

func (x *Seq) Reset()

func (*Seq) String

func (x *Seq) String() string

type UnimplementedDataMsgServiceServer

type UnimplementedDataMsgServiceServer struct {
}

UnimplementedDataMsgServiceServer must be embedded to have forward compatible implementations.

func (*UnimplementedDataMsgServiceServer) DataChanges

func (*UnimplementedDataMsgServiceServer) DataResyncs

func (*UnimplementedDataMsgServiceServer) Ping

Jump to

Keyboard shortcuts

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