msg

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package msg is a generated protocol buffer package.

It is generated from these files:

msg/datamsg.proto

It has these top-level messages:

DataMsgRequest
DataResyncRequests
DataResyncReplies
DataMsgReply
DataChangeRequest
DataChangeReply
DataResyncRequest
DataResyncReply
ResyncNeededCallback
Seq
Error
PingRequest
PingReply

Package msg contains: - the definition of PROTOBUF structures and GRPC service - plus 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",
}
View Source
var PutDel_value = map[string]int32{
	"PUT": 0,
	"DEL": 1,
}

Functions

func DataMsgRequestToKVs

func DataMsgRequestToKVs(req *DataMsgRequest, keyPrefixes []string) map[string][]datasync.KeyVal

DataMsgRequestToKVs TODO

func RegisterDataMsgServiceServer

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

Types

type ChangeWatchResp

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

ChangeWatchResp adapts Datamessage to interface datasync.ChangeEvent

func NewChangeWatchResp

func NewChangeWatchResp(message *DataChangeRequest, callback func(error)) *ChangeWatchResp

NewChangeWatchResp is a constructor

func (*ChangeWatchResp) Done

func (ev *ChangeWatchResp) Done(err error)

Done does nothing yet

func (*ChangeWatchResp) GetChangeType

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

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 {
	ChangeId      *Seq   `protobuf:"bytes,1,opt,name=changeId" json:"changeId,omitempty"`
	Key           string `protobuf:"bytes,2,opt,name=key" json:"key,omitempty"`
	OperationType PutDel `protobuf:"varint,3,opt,name=operationType,enum=msg.PutDel" json:"operationType,omitempty"`
	// zero means success
	Result uint32 `protobuf:"varint,4,opt,name=result" json:"result,omitempty"`
	Error  *Error `protobuf:"bytes,5,opt,name=error" json:"error,omitempty"`
}

func (*DataChangeReply) Descriptor

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

func (*DataChangeReply) GetChangeId

func (m *DataChangeReply) GetChangeId() *Seq

func (*DataChangeReply) GetError

func (m *DataChangeReply) GetError() *Error

func (*DataChangeReply) GetKey

func (m *DataChangeReply) GetKey() string

func (*DataChangeReply) GetOperationType

func (m *DataChangeReply) GetOperationType() PutDel

func (*DataChangeReply) GetResult

func (m *DataChangeReply) GetResult() uint32

func (*DataChangeReply) ProtoMessage

func (*DataChangeReply) ProtoMessage()

func (*DataChangeReply) Reset

func (m *DataChangeReply) Reset()

func (*DataChangeReply) String

func (m *DataChangeReply) String() string

type DataChangeRequest

type DataChangeRequest struct {
	Key           string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"`
	OperationType PutDel `protobuf:"varint,2,opt,name=operationType,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" json:"content_type,omitempty"`
}

func (*DataChangeRequest) Descriptor

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

func (*DataChangeRequest) GetContent

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

func (*DataChangeRequest) GetContentType

func (m *DataChangeRequest) GetContentType() string

func (*DataChangeRequest) GetKey

func (m *DataChangeRequest) GetKey() string

func (*DataChangeRequest) GetOperationType

func (m *DataChangeRequest) GetOperationType() PutDel

func (*DataChangeRequest) ProtoMessage

func (*DataChangeRequest) ProtoMessage()

func (*DataChangeRequest) Reset

func (m *DataChangeRequest) Reset()

func (*DataChangeRequest) String

func (m *DataChangeRequest) String() string

type DataMsgReply

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

func (*DataMsgReply) Descriptor

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

func (*DataMsgReply) GetDataChanges

func (m *DataMsgReply) GetDataChanges() *DataMsgReply_DataChangesReplies

func (*DataMsgReply) GetDataResyncs

func (m *DataMsgReply) GetDataResyncs() *DataMsgReply_DataResyncsReplies

func (*DataMsgReply) GetError

func (m *DataMsgReply) GetError() *Error

func (*DataMsgReply) GetMsgId

func (m *DataMsgReply) GetMsgId() *Seq

func (*DataMsgReply) ProtoMessage

func (*DataMsgReply) ProtoMessage()

func (*DataMsgReply) Reset

func (m *DataMsgReply) Reset()

func (*DataMsgReply) String

func (m *DataMsgReply) String() string

type DataMsgReply_DataChangesReplies

type DataMsgReply_DataChangesReplies struct {
	Replies []*DataChangeReply `protobuf:"bytes,1,rep,name=replies" json:"replies,omitempty"`
}

func (*DataMsgReply_DataChangesReplies) Descriptor

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

func (*DataMsgReply_DataChangesReplies) GetReplies

func (*DataMsgReply_DataChangesReplies) ProtoMessage

func (*DataMsgReply_DataChangesReplies) ProtoMessage()

func (*DataMsgReply_DataChangesReplies) Reset

func (*DataMsgReply_DataChangesReplies) String

type DataMsgReply_DataResyncsReplies

type DataMsgReply_DataResyncsReplies struct {
	Replies []*DataResyncReply `protobuf:"bytes,1,rep,name=replies" json:"replies,omitempty"`
}

func (*DataMsgReply_DataResyncsReplies) Descriptor

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

func (*DataMsgReply_DataResyncsReplies) GetReplies

func (*DataMsgReply_DataResyncsReplies) ProtoMessage

func (*DataMsgReply_DataResyncsReplies) ProtoMessage()

func (*DataMsgReply_DataResyncsReplies) Reset

func (*DataMsgReply_DataResyncsReplies) String

type DataMsgRequest

type DataMsgRequest struct {
	MsgId       *Seq                 `protobuf:"bytes,1,opt,name=msgId" json:"msgId,omitempty"`
	Txn         *Seq                 `protobuf:"bytes,2,opt,name=txn" json:"txn,omitempty"`
	DataChanges []*DataChangeRequest `protobuf:"bytes,3,rep,name=dataChanges" json:"dataChanges,omitempty"`
	DataResyncs []*DataResyncRequest `protobuf:"bytes,4,rep,name=dataResyncs" json:"dataResyncs,omitempty"`
}

func (*DataMsgRequest) Descriptor

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

func (*DataMsgRequest) GetDataChanges

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

func (*DataMsgRequest) GetDataResyncs

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

func (*DataMsgRequest) GetMsgId

func (m *DataMsgRequest) GetMsgId() *Seq

func (*DataMsgRequest) GetTxn

func (m *DataMsgRequest) GetTxn() *Seq

func (*DataMsgRequest) ProtoMessage

func (*DataMsgRequest) ProtoMessage()

func (*DataMsgRequest) Reset

func (m *DataMsgRequest) Reset()

func (*DataMsgRequest) String

func (m *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)
}

func NewDataMsgServiceClient

func NewDataMsgServiceClient(cc *grpc.ClientConn) DataMsgServiceClient

type DataMsgServiceServer

type DataMsgServiceServer interface {
	DataChanges(DataMsgService_DataChangesServer) error
	DataResyncs(context.Context, *DataResyncRequests) (*DataResyncReplies, error)
	Ping(context.Context, *PingRequest) (*PingReply, error)
}

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" json:"msgId,omitempty"`
	Error       *Error                                `protobuf:"bytes,2,opt,name=error" json:"error,omitempty"`
	DataResyncs *DataResyncReplies_DataResyncsReplies `protobuf:"bytes,3,opt,name=dataResyncs" json:"dataResyncs,omitempty"`
}

func (*DataResyncReplies) Descriptor

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

func (*DataResyncReplies) GetDataResyncs

func (*DataResyncReplies) GetError

func (m *DataResyncReplies) GetError() *Error

func (*DataResyncReplies) GetMsgId

func (m *DataResyncReplies) GetMsgId() *Seq

func (*DataResyncReplies) ProtoMessage

func (*DataResyncReplies) ProtoMessage()

func (*DataResyncReplies) Reset

func (m *DataResyncReplies) Reset()

func (*DataResyncReplies) String

func (m *DataResyncReplies) String() string

type DataResyncReplies_DataResyncsReplies

type DataResyncReplies_DataResyncsReplies struct {
	Replies []*DataResyncReply `protobuf:"bytes,1,rep,name=replies" json:"replies,omitempty"`
}

func (*DataResyncReplies_DataResyncsReplies) Descriptor

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

func (*DataResyncReplies_DataResyncsReplies) GetReplies

func (*DataResyncReplies_DataResyncsReplies) ProtoMessage

func (*DataResyncReplies_DataResyncsReplies) ProtoMessage()

func (*DataResyncReplies_DataResyncsReplies) Reset

func (*DataResyncReplies_DataResyncsReplies) String

type DataResyncReply

type DataResyncReply struct {
	ResyncId *Seq   `protobuf:"bytes,1,opt,name=resyncId" json:"resyncId,omitempty"`
	Key      string `protobuf:"bytes,2,opt,name=key" json:"key,omitempty"`
	// zero means success
	Result uint32 `protobuf:"varint,3,opt,name=result" json:"result,omitempty"`
	Error  *Error `protobuf:"bytes,4,opt,name=error" json:"error,omitempty"`
}

func (*DataResyncReply) Descriptor

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

func (*DataResyncReply) GetError

func (m *DataResyncReply) GetError() *Error

func (*DataResyncReply) GetKey

func (m *DataResyncReply) GetKey() string

func (*DataResyncReply) GetResult

func (m *DataResyncReply) GetResult() uint32

func (*DataResyncReply) GetResyncId

func (m *DataResyncReply) GetResyncId() *Seq

func (*DataResyncReply) ProtoMessage

func (*DataResyncReply) ProtoMessage()

func (*DataResyncReply) Reset

func (m *DataResyncReply) Reset()

func (*DataResyncReply) String

func (m *DataResyncReply) String() string

type DataResyncRequest

type DataResyncRequest struct {
	Key         string `protobuf:"bytes,1,opt,name=key" 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" json:"content_type,omitempty"`
}

func (*DataResyncRequest) Descriptor

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

func (*DataResyncRequest) GetContent

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

func (*DataResyncRequest) GetContentType

func (m *DataResyncRequest) GetContentType() string

func (*DataResyncRequest) GetKey

func (m *DataResyncRequest) GetKey() string

func (*DataResyncRequest) ProtoMessage

func (*DataResyncRequest) ProtoMessage()

func (*DataResyncRequest) Reset

func (m *DataResyncRequest) Reset()

func (*DataResyncRequest) String

func (m *DataResyncRequest) String() string

type DataResyncRequests

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

func (*DataResyncRequests) Descriptor

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

func (*DataResyncRequests) GetDataResyncs

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

func (*DataResyncRequests) GetMsgId

func (m *DataResyncRequests) GetMsgId() *Seq

func (*DataResyncRequests) ProtoMessage

func (*DataResyncRequests) ProtoMessage()

func (*DataResyncRequests) Reset

func (m *DataResyncRequests) Reset()

func (*DataResyncRequests) String

func (m *DataResyncRequests) String() string

type Error

type Error struct {
	Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"`
}

func (*Error) Descriptor

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

func (*Error) GetMessage

func (m *Error) GetMessage() string

func (*Error) ProtoMessage

func (*Error) ProtoMessage()

func (*Error) Reset

func (m *Error) Reset()

func (*Error) String

func (m *Error) String() string

type PingReply

type PingReply struct {
	Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"`
}

func (*PingReply) Descriptor

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

func (*PingReply) GetMessage

func (m *PingReply) GetMessage() string

func (*PingReply) ProtoMessage

func (*PingReply) ProtoMessage()

func (*PingReply) Reset

func (m *PingReply) Reset()

func (*PingReply) String

func (m *PingReply) String() string

type PingRequest

type PingRequest struct {
	Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"`
}

func (*PingRequest) Descriptor

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

func (*PingRequest) GetMessage

func (m *PingRequest) GetMessage() string

func (*PingRequest) ProtoMessage

func (*PingRequest) ProtoMessage()

func (*PingRequest) Reset

func (m *PingRequest) Reset()

func (*PingRequest) String

func (m *PingRequest) String() string

type PutDel

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

func (PutDel) EnumDescriptor

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

func (PutDel) String

func (x PutDel) String() string

type ResyncNeededCallback

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

func (*ResyncNeededCallback) Descriptor

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

func (*ResyncNeededCallback) GetError

func (m *ResyncNeededCallback) GetError() *Error

func (*ResyncNeededCallback) GetMsgId

func (m *ResyncNeededCallback) GetMsgId() *Seq

func (*ResyncNeededCallback) ProtoMessage

func (*ResyncNeededCallback) ProtoMessage()

func (*ResyncNeededCallback) Reset

func (m *ResyncNeededCallback) Reset()

func (*ResyncNeededCallback) String

func (m *ResyncNeededCallback) String() string

type Seq

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

func (*Seq) Descriptor

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

func (*Seq) GetOriginator

func (m *Seq) GetOriginator() string

func (*Seq) GetSeq

func (m *Seq) GetSeq() uint32

func (*Seq) GetSeqCreatedSec

func (m *Seq) GetSeqCreatedSec() int64

func (*Seq) ProtoMessage

func (*Seq) ProtoMessage()

func (*Seq) Reset

func (m *Seq) Reset()

func (*Seq) String

func (m *Seq) String() string

Jump to

Keyboard shortcuts

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