Documentation
¶
Index ¶
- Variables
- func RegisterChatServiceServer(s *grpc.Server, srv ChatServiceServer)
- type ChatServiceClient
- type ChatServiceServer
- type ChatService_StreamChatClient
- type ChatService_StreamChatServer
- type Client
- type LoginRequest
- type LoginResponse
- func (*LoginResponse) Descriptor() ([]byte, []int)deprecated
- func (x *LoginResponse) GetId() int32
- func (x *LoginResponse) GetMessage() string
- func (x *LoginResponse) GetStatus() bool
- func (*LoginResponse) ProtoMessage()
- func (x *LoginResponse) ProtoReflect() protoreflect.Message
- func (x *LoginResponse) Reset()
- func (x *LoginResponse) String() string
- type Message
- type Server
- type StreamMessage
- func (*StreamMessage) Descriptor() ([]byte, []int)deprecated
- func (x *StreamMessage) GetContent() string
- func (x *StreamMessage) GetName() string
- func (x *StreamMessage) GetType() string
- func (*StreamMessage) ProtoMessage()
- func (x *StreamMessage) ProtoReflect() protoreflect.Message
- func (x *StreamMessage) Reset()
- func (x *StreamMessage) String() string
- type UnimplementedChatServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_chat_proto protoreflect.FileDescriptor
Functions ¶
func RegisterChatServiceServer ¶
func RegisterChatServiceServer(s *grpc.Server, srv ChatServiceServer)
Types ¶
type ChatServiceClient ¶
type ChatServiceClient interface {
SayHello(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error)
Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error)
StreamChat(ctx context.Context, opts ...grpc.CallOption) (ChatService_StreamChatClient, error)
}
ChatServiceClient is the client API for ChatService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewChatServiceClient ¶
func NewChatServiceClient(cc grpc.ClientConnInterface) ChatServiceClient
type ChatServiceServer ¶
type ChatServiceServer interface {
SayHello(context.Context, *Message) (*Message, error)
Login(context.Context, *LoginRequest) (*LoginResponse, error)
StreamChat(ChatService_StreamChatServer) error
}
ChatServiceServer is the server API for ChatService service.
type ChatService_StreamChatClient ¶
type ChatService_StreamChatClient interface {
Send(*StreamMessage) error
Recv() (*StreamMessage, error)
grpc.ClientStream
}
type ChatService_StreamChatServer ¶
type ChatService_StreamChatServer interface {
Send(*StreamMessage) error
Recv() (*StreamMessage, error)
grpc.ServerStream
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client structure to hold client info
type LoginRequest ¶
type LoginRequest struct {
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
// contains filtered or unexported fields
}
func (*LoginRequest) Descriptor
deprecated
func (*LoginRequest) Descriptor() ([]byte, []int)
Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead.
func (*LoginRequest) GetName ¶
func (x *LoginRequest) GetName() string
func (*LoginRequest) ProtoMessage ¶
func (*LoginRequest) ProtoMessage()
func (*LoginRequest) ProtoReflect ¶
func (x *LoginRequest) ProtoReflect() protoreflect.Message
func (*LoginRequest) Reset ¶
func (x *LoginRequest) Reset()
func (*LoginRequest) String ¶
func (x *LoginRequest) String() string
type LoginResponse ¶
type LoginResponse struct {
Status bool `protobuf:"varint,3,opt,name=status,proto3" json:"status,omitempty"`
Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"`
Id int32 `protobuf:"varint,5,opt,name=id,proto3" json:"id,omitempty"`
// contains filtered or unexported fields
}
func (*LoginResponse) Descriptor
deprecated
func (*LoginResponse) Descriptor() ([]byte, []int)
Deprecated: Use LoginResponse.ProtoReflect.Descriptor instead.
func (*LoginResponse) GetId ¶
func (x *LoginResponse) GetId() int32
func (*LoginResponse) GetMessage ¶
func (x *LoginResponse) GetMessage() string
func (*LoginResponse) GetStatus ¶
func (x *LoginResponse) GetStatus() bool
func (*LoginResponse) ProtoMessage ¶
func (*LoginResponse) ProtoMessage()
func (*LoginResponse) ProtoReflect ¶
func (x *LoginResponse) ProtoReflect() protoreflect.Message
func (*LoginResponse) Reset ¶
func (x *LoginResponse) Reset()
func (*LoginResponse) String ¶
func (x *LoginResponse) String() string
type Message ¶
type Message struct {
Body string `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"`
// contains filtered or unexported fields
}
func (*Message) Descriptor
deprecated
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
func (*Message) ProtoReflect ¶
func (x *Message) ProtoReflect() protoreflect.Message
type Server ¶
Server implementation of grcp server interface
func (*Server) Login ¶
func (s *Server) Login(ctx context.Context, msg *LoginRequest) (*LoginResponse, error)
Login implementation of client login
func (*Server) StreamChat ¶
func (s *Server) StreamChat(stream ChatService_StreamChatServer) error
StreamChat process continuous chat flow
type StreamMessage ¶
type StreamMessage struct {
Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"`
Content string `protobuf:"bytes,7,opt,name=content,proto3" json:"content,omitempty"`
Name string `protobuf:"bytes,8,opt,name=name,proto3" json:"name,omitempty"`
// contains filtered or unexported fields
}
func (*StreamMessage) Descriptor
deprecated
func (*StreamMessage) Descriptor() ([]byte, []int)
Deprecated: Use StreamMessage.ProtoReflect.Descriptor instead.
func (*StreamMessage) GetContent ¶
func (x *StreamMessage) GetContent() string
func (*StreamMessage) GetName ¶
func (x *StreamMessage) GetName() string
func (*StreamMessage) GetType ¶
func (x *StreamMessage) GetType() string
func (*StreamMessage) ProtoMessage ¶
func (*StreamMessage) ProtoMessage()
func (*StreamMessage) ProtoReflect ¶
func (x *StreamMessage) ProtoReflect() protoreflect.Message
func (*StreamMessage) Reset ¶
func (x *StreamMessage) Reset()
func (*StreamMessage) String ¶
func (x *StreamMessage) String() string
type UnimplementedChatServiceServer ¶
type UnimplementedChatServiceServer struct {
}
UnimplementedChatServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedChatServiceServer) Login ¶
func (*UnimplementedChatServiceServer) Login(context.Context, *LoginRequest) (*LoginResponse, error)
func (*UnimplementedChatServiceServer) StreamChat ¶
func (*UnimplementedChatServiceServer) StreamChat(ChatService_StreamChatServer) error