Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterEchoServer(s grpc.ServiceRegistrar, srv EchoServer)
- type EchoClient
- type EchoRequest
- func (*EchoRequest) Descriptor() ([]byte, []int)deprecated
- func (x *EchoRequest) GetCode() uint32
- func (x *EchoRequest) GetMessage() string
- func (*EchoRequest) ProtoMessage()
- func (x *EchoRequest) ProtoReflect() protoreflect.Message
- func (x *EchoRequest) Reset()
- func (x *EchoRequest) String() string
- type EchoResponse
- func (*EchoResponse) Descriptor() ([]byte, []int)deprecated
- func (x *EchoResponse) GetCode() uint32
- func (x *EchoResponse) GetMessage() string
- func (*EchoResponse) ProtoMessage()
- func (x *EchoResponse) ProtoReflect() protoreflect.Message
- func (x *EchoResponse) Reset()
- func (x *EchoResponse) String() string
- type EchoServer
- type Server
- type Service
- func (s *Service) Addr() string
- func (s *Service) Client(ctx context.Context) (EchoClient, error)
- func (s *Service) ClientWithTimeout(ctx context.Context, timeoutd *time.Duration) (EchoClient, error)
- func (s *Service) Dispose()
- func (s *Service) InfoClient(ctx context.Context) (*svcmeta.InfoClient, error)
- func (s *Service) Name() string
- func (s *Service) NewHealthCheckClient(ctx context.Context, name string) (*grpc.HealthCheckClient, error)
- func (s *Service) Serve() error
- type UnimplementedEchoServer
- type UnsafeEchoServer
- type Void
Constants ¶
const ( Echo_Echo_FullMethodName = "/Echo/Echo" Echo_NoEcho_FullMethodName = "/Echo/NoEcho" )
Variables ¶
var Echo_ServiceDesc = grpc.ServiceDesc{ ServiceName: "Echo", HandlerType: (*EchoServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Echo", Handler: _Echo_Echo_Handler, }, { MethodName: "NoEcho", Handler: _Echo_NoEcho_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "echo.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_echo_proto protoreflect.FileDescriptor
Functions ¶
func RegisterEchoServer ¶
func RegisterEchoServer(s grpc.ServiceRegistrar, srv EchoServer)
Types ¶
type EchoClient ¶
type EchoClient interface { Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) NoEcho(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*Void, 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 EchoRequest ¶
type EchoRequest struct { Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*EchoRequest) Descriptor
deprecated
func (*EchoRequest) Descriptor() ([]byte, []int)
Deprecated: Use EchoRequest.ProtoReflect.Descriptor instead.
func (*EchoRequest) GetCode ¶
func (x *EchoRequest) GetCode() uint32
func (*EchoRequest) GetMessage ¶
func (x *EchoRequest) GetMessage() string
func (*EchoRequest) ProtoMessage ¶
func (*EchoRequest) ProtoMessage()
func (*EchoRequest) ProtoReflect ¶
func (x *EchoRequest) ProtoReflect() protoreflect.Message
func (*EchoRequest) Reset ¶
func (x *EchoRequest) Reset()
func (*EchoRequest) String ¶
func (x *EchoRequest) String() string
type EchoResponse ¶
type EchoResponse struct { Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*EchoResponse) Descriptor
deprecated
func (*EchoResponse) Descriptor() ([]byte, []int)
Deprecated: Use EchoResponse.ProtoReflect.Descriptor instead.
func (*EchoResponse) GetCode ¶
func (x *EchoResponse) GetCode() uint32
func (*EchoResponse) GetMessage ¶
func (x *EchoResponse) GetMessage() string
func (*EchoResponse) ProtoMessage ¶
func (*EchoResponse) ProtoMessage()
func (*EchoResponse) ProtoReflect ¶
func (x *EchoResponse) ProtoReflect() protoreflect.Message
func (*EchoResponse) Reset ¶
func (x *EchoResponse) Reset()
func (*EchoResponse) String ¶
func (x *EchoResponse) String() string
type EchoServer ¶
type EchoServer interface { Echo(context.Context, *EchoRequest) (*EchoResponse, error) NoEcho(context.Context, *EchoRequest) (*Void, error) // contains filtered or unexported methods }
EchoServer is the server API for Echo service. All implementations must embed UnimplementedEchoServer for forward compatibility
type Server ¶
type Server struct {
UnimplementedEchoServer
}
func (*Server) Echo ¶
func (s *Server) Echo(_ context.Context, req *EchoRequest) (*EchoResponse, error)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewWithServer ¶
func NewWithServer(ctx context.Context, server EchoServer, h grpc.HealthCheckFn) (*Service, error)
func (*Service) ClientWithTimeout ¶
func (*Service) InfoClient ¶
func (*Service) NewHealthCheckClient ¶
type UnimplementedEchoServer ¶
type UnimplementedEchoServer struct { }
UnimplementedEchoServer must be embedded to have forward compatible implementations.
func (UnimplementedEchoServer) Echo ¶
func (UnimplementedEchoServer) Echo(context.Context, *EchoRequest) (*EchoResponse, error)
func (UnimplementedEchoServer) NoEcho ¶
func (UnimplementedEchoServer) NoEcho(context.Context, *EchoRequest) (*Void, 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.
type Void ¶
type Void struct {
// contains filtered or unexported fields
}
func (*Void) Descriptor
deprecated
func (*Void) ProtoMessage ¶
func (*Void) ProtoMessage()
func (*Void) ProtoReflect ¶
func (x *Void) ProtoReflect() protoreflect.Message