v1

package
v0.0.0-...-410a399 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	Service_Scalar_FullMethodName = "/thingz.io.grpc.grpcme.v1.Service/Scalar"
	Service_Stream_FullMethodName = "/thingz.io.grpc.grpcme.v1.Service/Stream"
)

Variables

View Source
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.

View Source
var File_sample_proto protoreflect.FileDescriptor
View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use Content.ProtoReflect.Descriptor instead.

func (*Content) GetData

func (x *Content) GetData() *anypb.Any

func (*Content) GetId

func (x *Content) GetId() string

func (*Content) GetMetadata

func (x *Content) GetMetadata() map[string]string

func (*Content) ProtoMessage

func (*Content) ProtoMessage()

func (*Content) ProtoReflect

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

func (*Content) Reset

func (x *Content) Reset()

func (*Content) String

func (x *Content) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Request.ProtoReflect.Descriptor instead.

func (*Request) GetContent

func (x *Request) GetContent() *Content

func (*Request) GetSent

func (x *Request) GetSent() *timestamppb.Timestamp

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) ProtoReflect

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

func (*Request) Reset

func (x *Request) Reset()

func (*Request) String

func (x *Request) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetMessageCount

func (x *Response) GetMessageCount() int64

func (*Response) GetMessagesProcessed

func (x *Response) GetMessagesProcessed() int64

func (*Response) GetProcessingDetails

func (x *Response) GetProcessingDetails() string

func (*Response) GetRequestId

func (x *Response) GetRequestId() string

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

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

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

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) Enum

func (Response_ResultType) EnumDescriptor deprecated

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

Deprecated: Use Response_ResultType.Descriptor instead.

func (Response_ResultType) Number

func (Response_ResultType) String

func (x Response_ResultType) String() string

func (Response_ResultType) Type

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_StreamClient interface {
	Send(*Request) error
	Recv() (*Response, error)
	grpc.ClientStream
}

type Service_StreamServer

type Service_StreamServer interface {
	Send(*Response) error
	Recv() (*Request, error)
	grpc.ServerStream
}

type UnimplementedServiceServer

type UnimplementedServiceServer struct {
}

UnimplementedServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedServiceServer) Scalar

func (UnimplementedServiceServer) Stream

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.

Jump to

Keyboard shortcuts

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