Documentation
¶
Index ¶
- Variables
- func RegisterEchoServiceServer(s grpc.ServiceRegistrar, srv EchoServiceServer)
- func RegisterHttpHandler()
- type EchoServiceClient
- type EchoServiceServer
- type GrpcServer
- type HttpServer
- type Request
- type Response
- type TcpServer
- type UdpServer
- type UnimplementedEchoServiceServer
- type UnsafeEchoServiceServer
- type WebSocketServer
Constants ¶
This section is empty.
Variables ¶
var EchoService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "proto.EchoService", HandlerType: (*EchoServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Echo", Handler: _EchoService_Echo_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "echo.proto", }
EchoService_ServiceDesc is the grpc.ServiceDesc for EchoService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_echo_proto protoreflect.FileDescriptor
Functions ¶
func RegisterEchoServiceServer ¶
func RegisterEchoServiceServer(s grpc.ServiceRegistrar, srv EchoServiceServer)
Types ¶
type EchoServiceClient ¶
type EchoServiceClient interface {
Echo(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
}
EchoServiceClient is the client API for EchoService 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 NewEchoServiceClient ¶
func NewEchoServiceClient(cc grpc.ClientConnInterface) EchoServiceClient
type EchoServiceServer ¶
EchoServiceServer is the server API for EchoService service. All implementations should embed UnimplementedEchoServiceServer for forward compatibility
type GrpcServer ¶
GrpcServer gRPC server
func NewGrpcServer ¶
func NewGrpcServer(host string, port int) (server *GrpcServer, err error)
func (*GrpcServer) Start ¶
func (s *GrpcServer) Start()
type HttpServer ¶
http server
func NewHttpServer ¶
func NewHttpServer(host string, port int) (server *HttpServer, err error)
new http server
type Request ¶
type Request struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*Request) Descriptor
deprecated
func (*Request) GetMessage ¶
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) ProtoReflect ¶
func (x *Request) ProtoReflect() protoreflect.Message
type Response ¶
type Response struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*Response) Descriptor
deprecated
func (*Response) GetMessage ¶
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶
func (x *Response) ProtoReflect() protoreflect.Message
type UnimplementedEchoServiceServer ¶
type UnimplementedEchoServiceServer struct { }
UnimplementedEchoServiceServer should be embedded to have forward compatible implementations.
type UnsafeEchoServiceServer ¶
type UnsafeEchoServiceServer interface {
// contains filtered or unexported methods
}
UnsafeEchoServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to EchoServiceServer will result in compilation errors.
type WebSocketServer ¶
websocket server
func NewWebSocketServer ¶
func NewWebSocketServer(host string, port int) (server *WebSocketServer, err error)
new websocket server
func (*WebSocketServer) Start ¶
func (s *WebSocketServer) Start() (err error)
start websocket server