Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
- type Content
- func (*Content) Descriptor() ([]byte, []int)deprecated
- func (x *Content) GetData() *anypb.Any
- func (x *Content) GetId() string
- func (x *Content) GetMetadata() map[string]string
- func (*Content) ProtoMessage()
- func (x *Content) ProtoReflect() protoreflect.Message
- func (x *Content) Reset()
- func (x *Content) String() string
- type Request
- type Response
- func (*Response) Descriptor() ([]byte, []int)deprecated
- func (x *Response) GetMessageCount() int64
- func (x *Response) GetMessagesProcessed() int64
- func (x *Response) GetProcessingDetails() string
- func (x *Response) GetRequestId() string
- func (*Response) ProtoMessage()
- func (x *Response) ProtoReflect() protoreflect.Message
- func (x *Response) Reset()
- func (x *Response) String() string
- type Response_ResultType
- func (Response_ResultType) Descriptor() protoreflect.EnumDescriptor
- func (x Response_ResultType) Enum() *Response_ResultType
- func (Response_ResultType) EnumDescriptor() ([]byte, []int)deprecated
- func (x Response_ResultType) Number() protoreflect.EnumNumber
- func (x Response_ResultType) String() string
- func (Response_ResultType) Type() protoreflect.EnumType
- type ServiceClient
- type ServiceServer
- type Service_StreamClient
- type Service_StreamServer
- type UnimplementedServiceServer
- type UnsafeServiceServer
Constants ¶
const ( Service_Scalar_FullMethodName = "/thingz.io.grpc.grpcme.v1.Service/Scalar" Service_Stream_FullMethodName = "/thingz.io.grpc.grpcme.v1.Service/Stream" )
Variables ¶
var ( Response_ResultType_name = map[int32]string{ 0: "RESULT_TYPE_UNSPECIFIED", 1: "RESULT_TYPE_SUCCESS", 2: "RESULT_TYPE_ERROR", } Response_ResultType_value = map[string]int32{ "RESULT_TYPE_UNSPECIFIED": 0, "RESULT_TYPE_SUCCESS": 1, "RESULT_TYPE_ERROR": 2, } )
Enum value maps for Response_ResultType.
var File_sample_proto protoreflect.FileDescriptor
var Service_ServiceDesc = grpc.ServiceDesc{ ServiceName: "thingz.io.grpc.grpcme.v1.Service", HandlerType: (*ServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Scalar", Handler: _Service_Scalar_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Stream", Handler: _Service_Stream_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "sample.proto", }
Service_ServiceDesc is the grpc.ServiceDesc for Service service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterServiceServer ¶
func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
Types ¶
type Content ¶
type Content struct { // Unique identifier for the message. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Actual content of the message in binary format. Data *anypb.Any `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // Additional information about the message in key-value pairs. Metadata map[string]string `` /* 157-byte string literal not displayed */ // contains filtered or unexported fields }
Content represents the message content with metadata.
func (*Content) Descriptor
deprecated
func (*Content) GetMetadata ¶
func (*Content) ProtoMessage ¶
func (*Content) ProtoMessage()
func (*Content) ProtoReflect ¶
func (x *Content) ProtoReflect() protoreflect.Message
type Request ¶
type Request struct { // The content to be sent in the request. Content *Content `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` // Timestamp when the message was sent, represented in Unix epoch format. Sent *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=sent,proto3" json:"sent,omitempty"` // contains filtered or unexported fields }
Request represents the request for a method invocation. It includes the content to be sent and a timestamp.
func (*Request) Descriptor
deprecated
func (*Request) GetContent ¶
func (*Request) GetSent ¶
func (x *Request) GetSent() *timestamppb.Timestamp
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) ProtoReflect ¶
func (x *Request) ProtoReflect() protoreflect.Message
type Response ¶
type Response struct { // Unique identifier correlating to the request. RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` // Total number of messages received in the request. MessageCount int64 `protobuf:"varint,2,opt,name=message_count,json=messageCount,proto3" json:"message_count,omitempty"` // Number of messages successfully processed. MessagesProcessed int64 `protobuf:"varint,3,opt,name=messages_processed,json=messagesProcessed,proto3" json:"messages_processed,omitempty"` // Detailed information or description of the processing result. ProcessingDetails string `protobuf:"bytes,4,opt,name=processing_details,json=processingDetails,proto3" json:"processing_details,omitempty"` // contains filtered or unexported fields }
Response represents the server's response to a request. It includes details like request ID and processing information.
func (*Response) Descriptor
deprecated
func (*Response) GetMessageCount ¶
func (*Response) GetMessagesProcessed ¶
func (*Response) GetProcessingDetails ¶
func (*Response) GetRequestId ¶
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶
func (x *Response) ProtoReflect() protoreflect.Message
type Response_ResultType ¶
type Response_ResultType int32
Enum to represent the result types of the operation.
const ( Response_RESULT_TYPE_UNSPECIFIED Response_ResultType = 0 // Default value, unspecified result type. Response_RESULT_TYPE_SUCCESS Response_ResultType = 1 // Indicates successful processing. Response_RESULT_TYPE_ERROR Response_ResultType = 2 // Indicates an error occurred. )
func (Response_ResultType) Descriptor ¶
func (Response_ResultType) Descriptor() protoreflect.EnumDescriptor
func (Response_ResultType) Enum ¶
func (x Response_ResultType) Enum() *Response_ResultType
func (Response_ResultType) EnumDescriptor
deprecated
func (Response_ResultType) EnumDescriptor() ([]byte, []int)
Deprecated: Use Response_ResultType.Descriptor instead.
func (Response_ResultType) Number ¶
func (x Response_ResultType) Number() protoreflect.EnumNumber
func (Response_ResultType) String ¶
func (x Response_ResultType) String() string
func (Response_ResultType) Type ¶
func (Response_ResultType) Type() protoreflect.EnumType
type ServiceClient ¶
type ServiceClient interface { // Scalar checks the connectivity and response time of the service. Scalar(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) // Stream continuously sends and receives response messages. // It is useful for scenarios where constant data flow is required. Stream(ctx context.Context, opts ...grpc.CallOption) (Service_StreamClient, error) }
ServiceClient is the client API for Service 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 NewServiceClient ¶
func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient
type ServiceServer ¶
type ServiceServer interface { // Scalar checks the connectivity and response time of the service. Scalar(context.Context, *Request) (*Response, error) // Stream continuously sends and receives response messages. // It is useful for scenarios where constant data flow is required. Stream(Service_StreamServer) error // contains filtered or unexported methods }
ServiceServer is the server API for Service service. All implementations must embed UnimplementedServiceServer for forward compatibility
type Service_StreamClient ¶
type Service_StreamServer ¶
type UnimplementedServiceServer ¶
type UnimplementedServiceServer struct { }
UnimplementedServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedServiceServer) Stream ¶
func (UnimplementedServiceServer) Stream(Service_StreamServer) error
type UnsafeServiceServer ¶
type UnsafeServiceServer interface {
// contains filtered or unexported methods
}
UnsafeServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ServiceServer will result in compilation errors.