Documentation ¶
Index ¶
- Variables
- func RegisterMessageReportServiceServer(s grpc.ServiceRegistrar, srv MessageReportServiceServer)
- type BufferFlush
- type FetchMessage
- type FetchMessageBatch
- type FileCache
- func (fc *FileCache) Close()
- func (fc *FileCache) Fetch(ctx context.Context) (message.Message, *IOResponse)
- func (fc *FileCache) FetchBatch(ctx context.Context) (message.MessageList, *IOResponse)
- func (fc *FileCache) Publish(ctx context.Context, msg message.Message) *IOResponse
- func (fc *FileCache) PublishBatch(ctx context.Context, batch message.MessageList) *IOResponse
- func (fc *FileCache) Start(ctx context.Context) error
- type FileChain
- type IOMessage
- func (x *IOMessage) Decode(p []byte) (err error)
- func (*IOMessage) Descriptor() ([]byte, []int)deprecated
- func (x *IOMessage) Encode() (p []byte, err error)
- func (x *IOMessage) GetCoding() string
- func (x *IOMessage) GetCompress() string
- func (x *IOMessage) GetDataType() string
- func (x *IOMessage) GetPayload() []byte
- func (*IOMessage) ProtoMessage()
- func (x *IOMessage) ProtoReflect() protoreflect.Message
- func (x *IOMessage) Reset()
- func (x *IOMessage) String() string
- func (x *IOMessage) With(opts ...IOMessageOption) *IOMessage
- type IOMessageBatch
- func (x *IOMessageBatch) AppendMessages(list []*IOMessage)
- func (x *IOMessageBatch) Decode(p []byte) (err error)
- func (*IOMessageBatch) Descriptor() ([]byte, []int)deprecated
- func (x *IOMessageBatch) Encode() (p []byte, err error)
- func (x *IOMessageBatch) Foreach(handler func(k int, msg message.Message) bool)
- func (x *IOMessageBatch) GetList() []*IOMessage
- func (x *IOMessageBatch) Length() int
- func (*IOMessageBatch) ProtoMessage()
- func (x *IOMessageBatch) ProtoReflect() protoreflect.Message
- func (x *IOMessageBatch) Reset()
- func (x *IOMessageBatch) SetMessages(list []*IOMessage)
- func (x *IOMessageBatch) String() string
- type IOMessageNative
- type IOMessageNativeOption
- type IOMessageOption
- type IOResponse
- func (*IOResponse) Descriptor() ([]byte, []int)deprecated
- func (x *IOResponse) GetCoding() string
- func (x *IOResponse) GetMessage() string
- func (x *IOResponse) GetPayload() []byte
- func (x *IOResponse) GetStatus() IOStatus
- func (x *IOResponse) IS(target *IOResponse) bool
- func (*IOResponse) ProtoMessage()
- func (x *IOResponse) ProtoReflect() protoreflect.Message
- func (x *IOResponse) Reset()
- func (x *IOResponse) String() string
- func (x *IOResponse) With(opts ...IOResponseOption) *IOResponse
- type IOResponseOption
- type IOStatus
- type MessageReportServiceClient
- type MessageReportServiceServer
- type MessageReportService_SendStreamClient
- type MessageReportService_SendStreamServer
- type PubAndSub
- type PubAndSubBatch
- type PubBatchAndFetchBatch
- type PubBatchAndSubBatch
- type PubPubBatchAndFetchFetchBatch
- type PubPubBatchAndSubSubBatch
- type PubStreamAndSubStream
- type PublishMessage
- type PublishMessageBatch
- type PublishMessageStream
- type SubscribeMessage
- type SubscribeMessageBatch
- type SubscribeMessageBatchHandler
- type SubscribeMessageHandler
- type SubscribeMessageStream
- type SubscribeMessageStreamHandler
- type UnimplementedMessageReportServiceServer
- func (UnimplementedMessageReportServiceServer) Send(context.Context, *IOMessage) (*IOResponse, error)
- func (UnimplementedMessageReportServiceServer) SendBatch(context.Context, *IOMessageBatch) (*IOResponse, error)
- func (UnimplementedMessageReportServiceServer) SendStream(MessageReportService_SendStreamServer) error
- type UnsafeMessageReportServiceServer
Constants ¶
This section is empty.
Variables ¶
var ( IOStatus_name = map[int32]string{ 0: "IOSuccess", 1: "IOClosed", 2: "IOUncompleted", 3: "IOWrongMsgType", 4: "IOK", 5: "IBusy", 6: "ITimeout", 7: "IFailed", 8: "OOK", 9: "OEMPTY", 10: "OBusy", 11: "OTimeout", 12: "OFailed", } IOStatus_value = map[string]int32{ "IOSuccess": 0, "IOClosed": 1, "IOUncompleted": 2, "IOWrongMsgType": 3, "IOK": 4, "IBusy": 5, "ITimeout": 6, "IFailed": 7, "OOK": 8, "OEMPTY": 9, "OBusy": 10, "OTimeout": 11, "OFailed": 12, } )
Enum value maps for IOStatus.
var ( ErrIOClosed = errors.New("io closed") ErrIOUncompleted = errors.New("io init uncompleted") )
var ( IOSuccess = NewIOResponse(IOStatus_IOSuccess, IORespWithMessage("io success")) IOClosed = NewIOResponse(IOStatus_IOClosed, IORespWithMessage("io closed")) IOUncompleted = NewIOResponse(IOStatus_IOUncompleted, IORespWithMessage("io init uncompleted")) IOWrongMsgType = NewIOResponse(IOStatus_IOWrongMsgType, IORespWithMessage("message assertion failed")) InputSuccess = NewIOResponse(IOStatus_IOK, IORespWithMessage("input success")) InputBusy = NewIOResponse(IOStatus_IBusy, IORespWithMessage("input busy")) InputTimeout = NewIOResponse(IOStatus_ITimeout, IORespWithMessage("input timeout")) InputFailed = NewIOResponse(IOStatus_IFailed, IORespWithMessage("input failed")) OutputSuccess = NewIOResponse(IOStatus_OOK, IORespWithMessage("output success")) OutputEmpty = NewIOResponse(IOStatus_OEMPTY, IORespWithMessage("output empty")) OutputBusy = NewIOResponse(IOStatus_OBusy, IORespWithMessage("output busy")) OutputTimeout = NewIOResponse(IOStatus_OTimeout, IORespWithMessage("output timeout")) OutputFailed = NewIOResponse(IOStatus_OFailed, IORespWithMessage("output failed")) )
var File_io_message_proto protoreflect.FileDescriptor
Functions ¶
func RegisterMessageReportServiceServer ¶
func RegisterMessageReportServiceServer(s grpc.ServiceRegistrar, srv MessageReportServiceServer)
Types ¶
type BufferFlush ¶
type BufferFlush struct {
// contains filtered or unexported fields
}
func NewBufferFlush ¶
func NewBufferFlush(maxSize int, d time.Duration) *BufferFlush
func (*BufferFlush) Close ¶
func (bf *BufferFlush) Close()
func (*BufferFlush) Publish ¶
func (bf *BufferFlush) Publish(ctx context.Context, msg message.Message) *IOResponse
func (*BufferFlush) Subscribe ¶
func (bf *BufferFlush) Subscribe(handler SubscribeMessageHandler) error
type FetchMessage ¶
type FetchMessage interface {
Fetch(ctx context.Context) (message.Message, *IOResponse)
}
type FetchMessageBatch ¶
type FetchMessageBatch interface {
FetchBatch(ctx context.Context) (message.MessageList, *IOResponse)
}
type FileCache ¶
func (*FileCache) FetchBatch ¶
func (fc *FileCache) FetchBatch(ctx context.Context) (message.MessageList, *IOResponse)
FetchBatch returns messages batch the number of message count depends: - readPageBuf not empty and SequentialDirectory not empty then return readIndex + pageSize - readPageBuf empty and SequentialDirectory not empty then return pageSize - readPageBuf not empty and SequentialDirectory empty and writePageBuf not empty then return readIndex + writeIndex - readPageBuf empty and SequentialDirectory empty and writePageBuf not empty then return writeIndex - readPageBuf empty and SequentialDirectory empty and writePageBuf empty return 0 the order of returning data is readPageBuf, SequentialDirectory, writePageBuf
func (*FileCache) PublishBatch ¶
func (fc *FileCache) PublishBatch(ctx context.Context, batch message.MessageList) *IOResponse
type FileChain ¶
type FileChain struct {
// contains filtered or unexported fields
}
func (*FileChain) FetchBatch ¶
func (fc *FileChain) FetchBatch(ctx context.Context) (message.MessageList, *IOResponse)
func (*FileChain) PublishBatch ¶
func (fc *FileChain) PublishBatch(ctx context.Context, batch message.MessageList) *IOResponse
type IOMessage ¶
type IOMessage struct { DataType string `protobuf:"bytes,1,opt,name=DataType,proto3" json:"DataType,omitempty"` Coding string `protobuf:"bytes,2,opt,name=Coding,proto3" json:"Coding,omitempty"` Compress string `protobuf:"bytes,3,opt,name=Compress,proto3" json:"Compress,omitempty"` Payload []byte `protobuf:"bytes,4,opt,name=Payload,proto3" json:"Payload,omitempty"` // contains filtered or unexported fields }
func NewIOMessage ¶
func NewIOMessage(opts ...IOMessageOption) *IOMessage
func (*IOMessage) Descriptor
deprecated
func (*IOMessage) GetCompress ¶
func (*IOMessage) GetDataType ¶
func (*IOMessage) GetPayload ¶
func (*IOMessage) ProtoMessage ¶
func (*IOMessage) ProtoMessage()
func (*IOMessage) ProtoReflect ¶
func (x *IOMessage) ProtoReflect() protoreflect.Message
func (*IOMessage) With ¶
func (x *IOMessage) With(opts ...IOMessageOption) *IOMessage
type IOMessageBatch ¶
type IOMessageBatch struct { List []*IOMessage `protobuf:"bytes,1,rep,name=List,proto3" json:"List,omitempty"` // contains filtered or unexported fields }
func (*IOMessageBatch) AppendMessages ¶
func (x *IOMessageBatch) AppendMessages(list []*IOMessage)
func (*IOMessageBatch) Decode ¶
func (x *IOMessageBatch) Decode(p []byte) (err error)
func (*IOMessageBatch) Descriptor
deprecated
func (*IOMessageBatch) Descriptor() ([]byte, []int)
Deprecated: Use IOMessageBatch.ProtoReflect.Descriptor instead.
func (*IOMessageBatch) Encode ¶
func (x *IOMessageBatch) Encode() (p []byte, err error)
func (*IOMessageBatch) Foreach ¶
func (x *IOMessageBatch) Foreach(handler func(k int, msg message.Message) bool)
func (*IOMessageBatch) GetList ¶
func (x *IOMessageBatch) GetList() []*IOMessage
func (*IOMessageBatch) Length ¶
func (x *IOMessageBatch) Length() int
func (*IOMessageBatch) ProtoMessage ¶
func (*IOMessageBatch) ProtoMessage()
func (*IOMessageBatch) ProtoReflect ¶
func (x *IOMessageBatch) ProtoReflect() protoreflect.Message
func (*IOMessageBatch) Reset ¶
func (x *IOMessageBatch) Reset()
func (*IOMessageBatch) SetMessages ¶
func (x *IOMessageBatch) SetMessages(list []*IOMessage)
func (*IOMessageBatch) String ¶
func (x *IOMessageBatch) String() string
type IOMessageNative ¶
type IOMessageNative struct { IOMessage Payload interface{} }
func NewIOMessageNative ¶
func NewIOMessageNative(opts ...IOMessageNativeOption) *IOMessageNative
func (*IOMessageNative) With ¶
func (x *IOMessageNative) With(opts ...IOMessageNativeOption) *IOMessageNative
type IOMessageNativeOption ¶
type IOMessageNativeOption func(message *IOMessageNative)
func IOMsgNativeWithCoding ¶
func IOMsgNativeWithCoding(coding string) IOMessageNativeOption
func IOMsgNativeWithCompress ¶
func IOMsgNativeWithCompress(compress string) IOMessageNativeOption
func IOMsgNativeWithDataType ¶
func IOMsgNativeWithDataType(dataType string) IOMessageNativeOption
func IOMsgNativeWithPayload ¶
func IOMsgNativeWithPayload(payload interface{}) IOMessageNativeOption
type IOMessageOption ¶
type IOMessageOption func(message *IOMessage)
func IOMessageWithCoding ¶
func IOMessageWithCoding(coding string) IOMessageOption
func IOMessageWithCompress ¶
func IOMessageWithCompress(compress string) IOMessageOption
func IOMessageWithDataType ¶
func IOMessageWithDataType(dataType string) IOMessageOption
func IOMessageWithPayload ¶
func IOMessageWithPayload(payload []byte) IOMessageOption
type IOResponse ¶
type IOResponse struct { Status IOStatus `protobuf:"varint,1,opt,name=Status,proto3,enum=io.IOStatus" json:"Status,omitempty"` Message string `protobuf:"bytes,2,opt,name=Message,proto3" json:"Message,omitempty"` Coding string `protobuf:"bytes,3,opt,name=Coding,proto3" json:"Coding,omitempty"` Payload []byte `protobuf:"bytes,4,opt,name=Payload,proto3" json:"Payload,omitempty"` // contains filtered or unexported fields }
func NewIOResponse ¶
func NewIOResponse(status IOStatus, opts ...IOResponseOption) *IOResponse
func (*IOResponse) Descriptor
deprecated
func (*IOResponse) Descriptor() ([]byte, []int)
Deprecated: Use IOResponse.ProtoReflect.Descriptor instead.
func (*IOResponse) GetCoding ¶
func (x *IOResponse) GetCoding() string
func (*IOResponse) GetMessage ¶
func (x *IOResponse) GetMessage() string
func (*IOResponse) GetPayload ¶
func (x *IOResponse) GetPayload() []byte
func (*IOResponse) GetStatus ¶
func (x *IOResponse) GetStatus() IOStatus
func (*IOResponse) IS ¶
func (x *IOResponse) IS(target *IOResponse) bool
func (*IOResponse) ProtoMessage ¶
func (*IOResponse) ProtoMessage()
func (*IOResponse) ProtoReflect ¶
func (x *IOResponse) ProtoReflect() protoreflect.Message
func (*IOResponse) Reset ¶
func (x *IOResponse) Reset()
func (*IOResponse) String ¶
func (x *IOResponse) String() string
func (*IOResponse) With ¶
func (x *IOResponse) With(opts ...IOResponseOption) *IOResponse
type IOResponseOption ¶
type IOResponseOption func(ioresp *IOResponse)
func IORespWithMessage ¶
func IORespWithMessage(s string) IOResponseOption
func IORespWithPayload ¶
func IORespWithPayload(coding string, payload []byte) IOResponseOption
func IORespWithStatus ¶
func IORespWithStatus(status IOStatus) IOResponseOption
type IOStatus ¶
type IOStatus int32
const ( IOStatus_IOSuccess IOStatus = 0 IOStatus_IOClosed IOStatus = 1 IOStatus_IOUncompleted IOStatus = 2 IOStatus_IOWrongMsgType IOStatus = 3 IOStatus_IOK IOStatus = 4 IOStatus_IBusy IOStatus = 5 IOStatus_ITimeout IOStatus = 6 IOStatus_IFailed IOStatus = 7 IOStatus_OOK IOStatus = 8 IOStatus_OEMPTY IOStatus = 9 IOStatus_OBusy IOStatus = 10 IOStatus_OTimeout IOStatus = 11 IOStatus_OFailed IOStatus = 12 )
func (IOStatus) Descriptor ¶
func (IOStatus) Descriptor() protoreflect.EnumDescriptor
func (IOStatus) EnumDescriptor
deprecated
func (IOStatus) Number ¶
func (x IOStatus) Number() protoreflect.EnumNumber
func (IOStatus) Type ¶
func (IOStatus) Type() protoreflect.EnumType
type MessageReportServiceClient ¶
type MessageReportServiceClient interface { Send(ctx context.Context, in *IOMessage, opts ...grpc.CallOption) (*IOResponse, error) SendBatch(ctx context.Context, in *IOMessageBatch, opts ...grpc.CallOption) (*IOResponse, error) SendStream(ctx context.Context, opts ...grpc.CallOption) (MessageReportService_SendStreamClient, error) }
MessageReportServiceClient is the client API for MessageReportService 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.
func NewMessageReportServiceClient ¶
func NewMessageReportServiceClient(cc grpc.ClientConnInterface) MessageReportServiceClient
type MessageReportServiceServer ¶
type MessageReportServiceServer interface { Send(context.Context, *IOMessage) (*IOResponse, error) SendBatch(context.Context, *IOMessageBatch) (*IOResponse, error) SendStream(MessageReportService_SendStreamServer) error // contains filtered or unexported methods }
MessageReportServiceServer is the server API for MessageReportService service. All implementations must embed UnimplementedMessageReportServiceServer for forward compatibility
type MessageReportService_SendStreamClient ¶
type MessageReportService_SendStreamClient interface { Send(*IOMessage) error CloseAndRecv() (*IOResponse, error) grpc.ClientStream }
type MessageReportService_SendStreamServer ¶
type MessageReportService_SendStreamServer interface { SendAndClose(*IOResponse) error Recv() (*IOMessage, error) grpc.ServerStream }
type PubAndSub ¶
type PubAndSub interface { PublishMessage SubscribeMessage }
type PubAndSubBatch ¶
type PubAndSubBatch interface { PublishMessage SubscribeMessageBatch }
type PubBatchAndFetchBatch ¶
type PubBatchAndFetchBatch interface { PublishMessageBatch FetchMessageBatch }
type PubBatchAndSubBatch ¶
type PubBatchAndSubBatch interface { PublishMessageBatch SubscribeMessageBatch }
type PubPubBatchAndFetchFetchBatch ¶
type PubPubBatchAndFetchFetchBatch interface { PublishMessage PublishMessageBatch FetchMessage FetchMessageBatch }
type PubPubBatchAndSubSubBatch ¶
type PubPubBatchAndSubSubBatch interface { PublishMessage PublishMessageBatch SubscribeMessage SubscribeMessageBatch }
type PubStreamAndSubStream ¶
type PubStreamAndSubStream interface { PublishMessageStream SubscribeMessageStream }
type PublishMessage ¶
type PublishMessage interface {
Publish(ctx context.Context, msg message.Message) *IOResponse
}
type PublishMessageBatch ¶
type PublishMessageBatch interface {
PublishBatch(ctx context.Context, batch message.MessageList) *IOResponse
}
type PublishMessageStream ¶
type PublishMessageStream interface {
PublishStream(ctx context.Context, stream chan message.Message) *IOResponse
}
type SubscribeMessage ¶
type SubscribeMessage interface {
Subscribe(handler SubscribeMessageHandler) error
}
type SubscribeMessageBatch ¶
type SubscribeMessageBatch interface {
SubscribeBatch(handler SubscribeMessageBatchHandler) error
}
type SubscribeMessageBatchHandler ¶
type SubscribeMessageBatchHandler func(ctx context.Context, batch message.MessageList) *IOResponse
func (SubscribeMessageBatchHandler) BindContext ¶
func (h SubscribeMessageBatchHandler) BindContext(ctx context.Context, batch message.MessageList) SubscribeMessageBatchHandler
type SubscribeMessageHandler ¶
type SubscribeMessageHandler func(ctx context.Context, msg message.Message) *IOResponse
func (SubscribeMessageHandler) BindContext ¶
func (h SubscribeMessageHandler) BindContext(ctx context.Context, msg message.Message) SubscribeMessageHandler
type SubscribeMessageStream ¶
type SubscribeMessageStream interface {
SubscribeStream(handler SubscribeMessageStreamHandler) error
}
type SubscribeMessageStreamHandler ¶
type SubscribeMessageStreamHandler func(ctx context.Context, stream chan message.Message, out chan *IOResponse)
func (SubscribeMessageStreamHandler) BindContext ¶
func (h SubscribeMessageStreamHandler) BindContext(ctx context.Context, stream chan message.Message, out chan *IOResponse) SubscribeMessageStreamHandler
type UnimplementedMessageReportServiceServer ¶
type UnimplementedMessageReportServiceServer struct { }
UnimplementedMessageReportServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedMessageReportServiceServer) Send ¶
func (UnimplementedMessageReportServiceServer) Send(context.Context, *IOMessage) (*IOResponse, error)
func (UnimplementedMessageReportServiceServer) SendBatch ¶
func (UnimplementedMessageReportServiceServer) SendBatch(context.Context, *IOMessageBatch) (*IOResponse, error)
func (UnimplementedMessageReportServiceServer) SendStream ¶
func (UnimplementedMessageReportServiceServer) SendStream(MessageReportService_SendStreamServer) error
type UnsafeMessageReportServiceServer ¶
type UnsafeMessageReportServiceServer interface {
// contains filtered or unexported methods
}
UnsafeMessageReportServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to MessageReportServiceServer will result in compilation errors.