Documentation ¶
Overview ¶
Package echo2 contains PROTO3 protoc-generated output and implements a test and demo echo services. It is intended as for reflect testing only.
Index ¶
- Variables
- func RegisterEchoServer(s grpc.ServiceRegistrar, srv EchoServer)
- type ColorType
- func (ColorType) Descriptor() protoreflect.EnumDescriptor
- func (x ColorType) Enum() *ColorType
- func (ColorType) EnumDescriptor() ([]byte, []int)deprecated
- func (x ColorType) Number() protoreflect.EnumNumber
- func (x ColorType) String() string
- func (ColorType) Type() protoreflect.EnumType
- func (x *ColorType) UnmarshalJSON(b []byte) errordeprecated
- type Details
- func (*Details) Descriptor() ([]byte, []int)deprecated
- func (x *Details) GetABool() bool
- func (x *Details) GetABytes() []byte
- func (x *Details) GetAFixed32() uint32
- func (x *Details) GetAFixed64() uint64
- func (x *Details) GetAInt32() int32
- func (x *Details) GetAInt64() int64
- func (x *Details) GetASfixed32() int32
- func (x *Details) GetASfixed64() int64
- func (x *Details) GetASint32() int32
- func (x *Details) GetASint64() int64
- func (x *Details) GetAString() string
- func (x *Details) GetAUint32() uint32
- func (x *Details) GetAUint64() uint64
- func (x *Details) GetAny() *anypb.Any
- func (x *Details) GetColorType() ColorType
- func (x *Details) GetLabelCount() map[string]int64
- func (x *Details) GetNotifications() []*Notification
- func (*Details) ProtoMessage()
- func (x *Details) ProtoReflect() protoreflect.Message
- func (x *Details) Reset()
- func (x *Details) String() string
- type EchoClient
- type EchoServer
- type Echo_HelloStreamClient
- type Echo_HelloStreamServer
- type HelloRequest
- func (*HelloRequest) Descriptor() ([]byte, []int)deprecated
- func (x *HelloRequest) GetMessage() string
- func (x *HelloRequest) GetMoreDetails() *Details
- func (*HelloRequest) ProtoMessage()
- func (x *HelloRequest) ProtoReflect() protoreflect.Message
- func (x *HelloRequest) Reset()
- func (x *HelloRequest) String() string
- type HelloResponse
- type Notification
- func (*Notification) Descriptor() ([]byte, []int)deprecated
- func (x *Notification) GetId() int32
- func (m *Notification) GetInstrument() isNotification_Instrument
- func (x *Notification) GetPrivate() *PrivateNotification
- func (x *Notification) GetPublic() *PublicNotification
- func (*Notification) ProtoMessage()
- func (x *Notification) ProtoReflect() protoreflect.Message
- func (x *Notification) Reset()
- func (x *Notification) String() string
- type Notification_Private
- type Notification_Public
- type PrivateNotification
- func (*PrivateNotification) Descriptor() ([]byte, []int)deprecated
- func (x *PrivateNotification) GetSecretContent() string
- func (*PrivateNotification) ProtoMessage()
- func (x *PrivateNotification) ProtoReflect() protoreflect.Message
- func (x *PrivateNotification) Reset()
- func (x *PrivateNotification) String() string
- type PublicNotification
- func (*PublicNotification) Descriptor() ([]byte, []int)deprecated
- func (x *PublicNotification) GetContent() string
- func (*PublicNotification) ProtoMessage()
- func (x *PublicNotification) ProtoReflect() protoreflect.Message
- func (x *PublicNotification) Reset()
- func (x *PublicNotification) String() string
- type Server
- type UnimplementedEchoServer
- type UnsafeEchoServer
Constants ¶
This section is empty.
Variables ¶
var ( ColorType_name = map[int32]string{ 0: "RED", 1: "BLUE", 2: "GREEN", } ColorType_value = map[string]int32{ "RED": 0, "BLUE": 1, "GREEN": 2, } )
Enum value maps for ColorType.
var Echo_ServiceDesc = grpc.ServiceDesc{ ServiceName: "echo2.Echo", HandlerType: (*EchoServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Hello", Handler: _Echo_Hello_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "HelloStream", Handler: _Echo_HelloStream_Handler, ServerStreams: true, }, }, Metadata: "echo2/echo2.proto", }
Echo_ServiceDesc is the grpc.ServiceDesc for Echo service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_echo2_echo2_proto protoreflect.FileDescriptor
Functions ¶
func RegisterEchoServer ¶
func RegisterEchoServer(s grpc.ServiceRegistrar, srv EchoServer)
Types ¶
type ColorType ¶
type ColorType int32
func (ColorType) Descriptor ¶
func (ColorType) Descriptor() protoreflect.EnumDescriptor
func (ColorType) EnumDescriptor
deprecated
func (ColorType) Number ¶
func (x ColorType) Number() protoreflect.EnumNumber
func (ColorType) Type ¶
func (ColorType) Type() protoreflect.EnumType
func (*ColorType) UnmarshalJSON
deprecated
type Details ¶
type Details struct { LabelCount map[string]int64 `` /* 159-byte string literal not displayed */ ColorType *ColorType `protobuf:"varint,2,req,name=color_type,json=colorType,enum=echo2.ColorType" json:"color_type,omitempty"` Any *anypb.Any `protobuf:"bytes,3,req,name=any" json:"any,omitempty"` Notifications []*Notification `protobuf:"bytes,4,rep,name=notifications" json:"notifications,omitempty"` AInt32 *int32 `protobuf:"varint,5,opt,name=a_int32,json=aInt32" json:"a_int32,omitempty"` AUint32 *uint32 `protobuf:"varint,6,opt,name=a_uint32,json=aUint32" json:"a_uint32,omitempty"` AInt64 *int64 `protobuf:"varint,7,opt,name=a_int64,json=aInt64" json:"a_int64,omitempty"` AUint64 *uint64 `protobuf:"varint,8,opt,name=a_uint64,json=aUint64" json:"a_uint64,omitempty"` ABool *bool `protobuf:"varint,9,opt,name=a_bool,json=aBool" json:"a_bool,omitempty"` ASint32 *int32 `protobuf:"zigzag32,10,opt,name=a_sint32,json=aSint32" json:"a_sint32,omitempty"` ASint64 *int64 `protobuf:"zigzag64,11,opt,name=a_sint64,json=aSint64" json:"a_sint64,omitempty"` AString *string `protobuf:"bytes,12,opt,name=a_string,json=aString" json:"a_string,omitempty"` ABytes []byte `protobuf:"bytes,13,opt,name=a_bytes,json=aBytes" json:"a_bytes,omitempty"` AFixed32 *uint32 `protobuf:"fixed32,14,opt,name=a_fixed32,json=aFixed32" json:"a_fixed32,omitempty"` ASfixed32 *int32 `protobuf:"fixed32,15,opt,name=a_sfixed32,json=aSfixed32" json:"a_sfixed32,omitempty"` AFixed64 *uint64 `protobuf:"fixed64,16,opt,name=a_fixed64,json=aFixed64" json:"a_fixed64,omitempty"` ASfixed64 *int64 `protobuf:"fixed64,17,opt,name=a_sfixed64,json=aSfixed64" json:"a_sfixed64,omitempty"` // contains filtered or unexported fields }
func (*Details) Descriptor
deprecated
func (*Details) GetAFixed32 ¶
func (*Details) GetAFixed64 ¶
func (*Details) GetASfixed32 ¶
func (*Details) GetASfixed64 ¶
func (*Details) GetASint32 ¶
func (*Details) GetASint64 ¶
func (*Details) GetAString ¶
func (*Details) GetAUint32 ¶
func (*Details) GetAUint64 ¶
func (*Details) GetColorType ¶
func (*Details) GetLabelCount ¶
func (*Details) GetNotifications ¶
func (x *Details) GetNotifications() []*Notification
func (*Details) ProtoMessage ¶
func (*Details) ProtoMessage()
func (*Details) ProtoReflect ¶
func (x *Details) ProtoReflect() protoreflect.Message
type EchoClient ¶
type EchoClient interface { // Hello greets. Hello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloResponse, error) // HelloStream greets repeatedly. HelloStream(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (Echo_HelloStreamClient, error) }
EchoClient is the client API for Echo 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 NewEchoClient ¶
func NewEchoClient(cc grpc.ClientConnInterface) EchoClient
type EchoServer ¶
type EchoServer interface { // Hello greets. Hello(context.Context, *HelloRequest) (*HelloResponse, error) // HelloStream greets repeatedly. HelloStream(*HelloRequest, Echo_HelloStreamServer) error // contains filtered or unexported methods }
EchoServer is the server API for Echo service. All implementations must embed UnimplementedEchoServer for forward compatibility
type Echo_HelloStreamClient ¶
type Echo_HelloStreamClient interface { Recv() (*HelloResponse, error) grpc.ClientStream }
type Echo_HelloStreamServer ¶
type Echo_HelloStreamServer interface { Send(*HelloResponse) error grpc.ServerStream }
type HelloRequest ¶
type HelloRequest struct { Message *string `protobuf:"bytes,1,req,name=message" json:"message,omitempty"` MoreDetails *Details `protobuf:"bytes,2,opt,name=more_details,json=moreDetails" json:"more_details,omitempty"` // contains filtered or unexported fields }
func (*HelloRequest) Descriptor
deprecated
func (*HelloRequest) Descriptor() ([]byte, []int)
Deprecated: Use HelloRequest.ProtoReflect.Descriptor instead.
func (*HelloRequest) GetMessage ¶
func (x *HelloRequest) GetMessage() string
func (*HelloRequest) GetMoreDetails ¶
func (x *HelloRequest) GetMoreDetails() *Details
func (*HelloRequest) ProtoMessage ¶
func (*HelloRequest) ProtoMessage()
func (*HelloRequest) ProtoReflect ¶
func (x *HelloRequest) ProtoReflect() protoreflect.Message
func (*HelloRequest) Reset ¶
func (x *HelloRequest) Reset()
func (*HelloRequest) String ¶
func (x *HelloRequest) String() string
type HelloResponse ¶
type HelloResponse struct { RobotResponse *string `protobuf:"bytes,1,req,name=robot_response,json=robotResponse" json:"robot_response,omitempty"` // contains filtered or unexported fields }
func (*HelloResponse) Descriptor
deprecated
func (*HelloResponse) Descriptor() ([]byte, []int)
Deprecated: Use HelloResponse.ProtoReflect.Descriptor instead.
func (*HelloResponse) GetRobotResponse ¶
func (x *HelloResponse) GetRobotResponse() string
func (*HelloResponse) ProtoMessage ¶
func (*HelloResponse) ProtoMessage()
func (*HelloResponse) ProtoReflect ¶
func (x *HelloResponse) ProtoReflect() protoreflect.Message
func (*HelloResponse) Reset ¶
func (x *HelloResponse) Reset()
func (*HelloResponse) String ¶
func (x *HelloResponse) String() string
type Notification ¶
type Notification struct { Id *int32 `protobuf:"varint,1,req,name=id" json:"id,omitempty"` // Types that are assignable to Instrument: // *Notification_Private // *Notification_Public Instrument isNotification_Instrument `protobuf_oneof:"instrument"` // contains filtered or unexported fields }
func (*Notification) Descriptor
deprecated
func (*Notification) Descriptor() ([]byte, []int)
Deprecated: Use Notification.ProtoReflect.Descriptor instead.
func (*Notification) GetId ¶
func (x *Notification) GetId() int32
func (*Notification) GetInstrument ¶
func (m *Notification) GetInstrument() isNotification_Instrument
func (*Notification) GetPrivate ¶
func (x *Notification) GetPrivate() *PrivateNotification
func (*Notification) GetPublic ¶
func (x *Notification) GetPublic() *PublicNotification
func (*Notification) ProtoMessage ¶
func (*Notification) ProtoMessage()
func (*Notification) ProtoReflect ¶
func (x *Notification) ProtoReflect() protoreflect.Message
func (*Notification) Reset ¶
func (x *Notification) Reset()
func (*Notification) String ¶
func (x *Notification) String() string
type Notification_Private ¶
type Notification_Private struct {
Private *PrivateNotification `protobuf:"bytes,2,opt,name=private,oneof"`
}
type Notification_Public ¶
type Notification_Public struct {
Public *PublicNotification `protobuf:"bytes,3,opt,name=public,oneof"`
}
type PrivateNotification ¶
type PrivateNotification struct { SecretContent *string `protobuf:"bytes,1,req,name=secret_content,json=secretContent" json:"secret_content,omitempty"` // contains filtered or unexported fields }
func (*PrivateNotification) Descriptor
deprecated
func (*PrivateNotification) Descriptor() ([]byte, []int)
Deprecated: Use PrivateNotification.ProtoReflect.Descriptor instead.
func (*PrivateNotification) GetSecretContent ¶
func (x *PrivateNotification) GetSecretContent() string
func (*PrivateNotification) ProtoMessage ¶
func (*PrivateNotification) ProtoMessage()
func (*PrivateNotification) ProtoReflect ¶
func (x *PrivateNotification) ProtoReflect() protoreflect.Message
func (*PrivateNotification) Reset ¶
func (x *PrivateNotification) Reset()
func (*PrivateNotification) String ¶
func (x *PrivateNotification) String() string
type PublicNotification ¶
type PublicNotification struct { Content *string `protobuf:"bytes,1,req,name=content" json:"content,omitempty"` // contains filtered or unexported fields }
func (*PublicNotification) Descriptor
deprecated
func (*PublicNotification) Descriptor() ([]byte, []int)
Deprecated: Use PublicNotification.ProtoReflect.Descriptor instead.
func (*PublicNotification) GetContent ¶
func (x *PublicNotification) GetContent() string
func (*PublicNotification) ProtoMessage ¶
func (*PublicNotification) ProtoMessage()
func (*PublicNotification) ProtoReflect ¶
func (x *PublicNotification) ProtoReflect() protoreflect.Message
func (*PublicNotification) Reset ¶
func (x *PublicNotification) Reset()
func (*PublicNotification) String ¶
func (x *PublicNotification) String() string
type Server ¶
type Server struct {
UnimplementedEchoServer
}
Server implements the server-side of gRPC demo Phone service.
func (*Server) Hello ¶
func (*Server) Hello(_ context.Context, req *HelloRequest) (*HelloResponse, error)
Hello is a demo echo service.
func (*Server) HelloStream ¶
func (s *Server) HelloStream(req *HelloRequest, stream Echo_HelloStreamServer) error
HelloStream streaming RPC handler.
type UnimplementedEchoServer ¶
type UnimplementedEchoServer struct { }
UnimplementedEchoServer must be embedded to have forward compatible implementations.
func (UnimplementedEchoServer) Hello ¶
func (UnimplementedEchoServer) Hello(context.Context, *HelloRequest) (*HelloResponse, error)
func (UnimplementedEchoServer) HelloStream ¶
func (UnimplementedEchoServer) HelloStream(*HelloRequest, Echo_HelloStreamServer) error
type UnsafeEchoServer ¶
type UnsafeEchoServer interface {
// contains filtered or unexported methods
}
UnsafeEchoServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to EchoServer will result in compilation errors.