Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterChatServer(s grpc.ServiceRegistrar, srv ChatServer)
- func RegisterTemplateServer(s grpc.ServiceRegistrar, srv TemplateServer)
- type Ack
- type Amount
- type ChatClient
- type ChatMessage
- func (*ChatMessage) Descriptor() ([]byte, []int)deprecated
- func (x *ChatMessage) GetClientName() string
- func (x *ChatMessage) GetContent() string
- func (*ChatMessage) ProtoMessage()
- func (x *ChatMessage) ProtoReflect() protoreflect.Message
- func (x *ChatMessage) Reset()
- func (x *ChatMessage) String() string
- type ChatServer
- type Chat_ReceiveMessageStreamClient
- type Chat_ReceiveMessageStreamServer
- type ClientName
- type Farewell
- type Greeding
- type TemplateClient
- type TemplateServer
- type Template_SayHiClient
- type Template_SayHiServer
- type UnimplementedChatServer
- type UnimplementedTemplateServer
- type UnsafeChatServer
- type UnsafeTemplateServer
Constants ¶
const ( Template_Increment_FullMethodName = "/proto.Template/Increment" Template_SayHi_FullMethodName = "/proto.Template/SayHi" )
const ( Chat_SendMessage_FullMethodName = "/proto.Chat/SendMessage" Chat_ReceiveMessageStream_FullMethodName = "/proto.Chat/ReceiveMessageStream" )
Variables ¶
var Chat_ServiceDesc = grpc.ServiceDesc{ ServiceName: "proto.Chat", HandlerType: (*ChatServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SendMessage", Handler: _Chat_SendMessage_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "ReceiveMessageStream", Handler: _Chat_ReceiveMessageStream_Handler, ServerStreams: true, }, }, Metadata: "proto/template.proto", }
Chat_ServiceDesc is the grpc.ServiceDesc for Chat service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_proto_template_proto protoreflect.FileDescriptor
var Template_ServiceDesc = grpc.ServiceDesc{ ServiceName: "proto.Template", HandlerType: (*TemplateServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Increment", Handler: _Template_Increment_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "SayHi", Handler: _Template_SayHi_Handler, ClientStreams: true, }, }, Metadata: "proto/template.proto", }
Template_ServiceDesc is the grpc.ServiceDesc for Template service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterChatServer ¶
func RegisterChatServer(s grpc.ServiceRegistrar, srv ChatServer)
func RegisterTemplateServer ¶
func RegisterTemplateServer(s grpc.ServiceRegistrar, srv TemplateServer)
Types ¶
type Ack ¶
type Ack struct { NewValue int64 `protobuf:"varint,1,opt,name=newValue,proto3" json:"newValue,omitempty"` // gave it a status for the chat system Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` // contains filtered or unexported fields }
func (*Ack) Descriptor
deprecated
func (*Ack) GetNewValue ¶
func (*Ack) ProtoMessage ¶
func (*Ack) ProtoMessage()
func (*Ack) ProtoReflect ¶
func (x *Ack) ProtoReflect() protoreflect.Message
type Amount ¶
type Amount struct { ClientName string `protobuf:"bytes,1,opt,name=clientName,proto3" json:"clientName,omitempty"` Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
Amount is a type containing a string and int. They are intialized as the first and second parameter value.
func (*Amount) Descriptor
deprecated
func (*Amount) GetClientName ¶
func (*Amount) ProtoMessage ¶
func (*Amount) ProtoMessage()
func (*Amount) ProtoReflect ¶
func (x *Amount) ProtoReflect() protoreflect.Message
type ChatClient ¶
type ChatClient interface { // testing messaging system start SendMessage(ctx context.Context, in *ChatMessage, opts ...grpc.CallOption) (*Ack, error) ReceiveMessageStream(ctx context.Context, in *ClientName, opts ...grpc.CallOption) (Chat_ReceiveMessageStreamClient, error) }
ChatClient is the client API for Chat 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 NewChatClient ¶
func NewChatClient(cc grpc.ClientConnInterface) ChatClient
type ChatMessage ¶
type ChatMessage struct { ClientName string `protobuf:"bytes,1,opt,name=clientName,proto3" json:"clientName,omitempty"` Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` // contains filtered or unexported fields }
testing messaging system start
func (*ChatMessage) Descriptor
deprecated
func (*ChatMessage) Descriptor() ([]byte, []int)
Deprecated: Use ChatMessage.ProtoReflect.Descriptor instead.
func (*ChatMessage) GetClientName ¶
func (x *ChatMessage) GetClientName() string
func (*ChatMessage) GetContent ¶
func (x *ChatMessage) GetContent() string
func (*ChatMessage) ProtoMessage ¶
func (*ChatMessage) ProtoMessage()
func (*ChatMessage) ProtoReflect ¶
func (x *ChatMessage) ProtoReflect() protoreflect.Message
func (*ChatMessage) Reset ¶
func (x *ChatMessage) Reset()
func (*ChatMessage) String ¶
func (x *ChatMessage) String() string
type ChatServer ¶
type ChatServer interface { // testing messaging system start SendMessage(context.Context, *ChatMessage) (*Ack, error) ReceiveMessageStream(*ClientName, Chat_ReceiveMessageStreamServer) error // contains filtered or unexported methods }
ChatServer is the server API for Chat service. All implementations must embed UnimplementedChatServer for forward compatibility
type Chat_ReceiveMessageStreamClient ¶
type Chat_ReceiveMessageStreamClient interface { Recv() (*ChatMessage, error) grpc.ClientStream }
type Chat_ReceiveMessageStreamServer ¶
type Chat_ReceiveMessageStreamServer interface { Send(*ChatMessage) error grpc.ServerStream }
type ClientName ¶
type ClientName struct { ClientName string `protobuf:"bytes,1,opt,name=clientName,proto3" json:"clientName,omitempty"` // contains filtered or unexported fields }
func (*ClientName) Descriptor
deprecated
func (*ClientName) Descriptor() ([]byte, []int)
Deprecated: Use ClientName.ProtoReflect.Descriptor instead.
func (*ClientName) GetClientName ¶
func (x *ClientName) GetClientName() string
func (*ClientName) ProtoMessage ¶
func (*ClientName) ProtoMessage()
func (*ClientName) ProtoReflect ¶
func (x *ClientName) ProtoReflect() protoreflect.Message
func (*ClientName) Reset ¶
func (x *ClientName) Reset()
func (*ClientName) String ¶
func (x *ClientName) String() string
type Farewell ¶
type Farewell struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*Farewell) Descriptor
deprecated
func (*Farewell) GetMessage ¶
func (*Farewell) ProtoMessage ¶
func (*Farewell) ProtoMessage()
func (*Farewell) ProtoReflect ¶
func (x *Farewell) ProtoReflect() protoreflect.Message
type Greeding ¶
type Greeding struct { ClientName string `protobuf:"bytes,1,opt,name=clientName,proto3" json:"clientName,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*Greeding) Descriptor
deprecated
func (*Greeding) GetClientName ¶
func (*Greeding) GetMessage ¶
func (*Greeding) ProtoMessage ¶
func (*Greeding) ProtoMessage()
func (*Greeding) ProtoReflect ¶
func (x *Greeding) ProtoReflect() protoreflect.Message
type TemplateClient ¶
type TemplateClient interface { // one message is sent and one is recieved Increment(ctx context.Context, in *Amount, opts ...grpc.CallOption) (*Ack, error) // many messages are sent and one is recieved SayHi(ctx context.Context, opts ...grpc.CallOption) (Template_SayHiClient, error) }
TemplateClient is the client API for Template 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 NewTemplateClient ¶
func NewTemplateClient(cc grpc.ClientConnInterface) TemplateClient
type TemplateServer ¶
type TemplateServer interface { // one message is sent and one is recieved Increment(context.Context, *Amount) (*Ack, error) // many messages are sent and one is recieved SayHi(Template_SayHiServer) error // contains filtered or unexported methods }
TemplateServer is the server API for Template service. All implementations must embed UnimplementedTemplateServer for forward compatibility
type Template_SayHiClient ¶
type Template_SayHiServer ¶
type UnimplementedChatServer ¶
type UnimplementedChatServer struct { }
UnimplementedChatServer must be embedded to have forward compatible implementations.
func (UnimplementedChatServer) ReceiveMessageStream ¶
func (UnimplementedChatServer) ReceiveMessageStream(*ClientName, Chat_ReceiveMessageStreamServer) error
func (UnimplementedChatServer) SendMessage ¶
func (UnimplementedChatServer) SendMessage(context.Context, *ChatMessage) (*Ack, error)
type UnimplementedTemplateServer ¶
type UnimplementedTemplateServer struct { }
UnimplementedTemplateServer must be embedded to have forward compatible implementations.
func (UnimplementedTemplateServer) SayHi ¶
func (UnimplementedTemplateServer) SayHi(Template_SayHiServer) error
type UnsafeChatServer ¶
type UnsafeChatServer interface {
// contains filtered or unexported methods
}
UnsafeChatServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ChatServer will result in compilation errors.
type UnsafeTemplateServer ¶
type UnsafeTemplateServer interface {
// contains filtered or unexported methods
}
UnsafeTemplateServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TemplateServer will result in compilation errors.