Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var File_grpc_proto protoreflect.FileDescriptor
var Grpc_ServiceDesc = grpc.ServiceDesc{ ServiceName: "grpc.Grpc", HandlerType: (*GrpcServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Get", Handler: _Grpc_Get_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "grpc.proto", }
Grpc_ServiceDesc is the grpc.ServiceDesc for Grpc service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterGrpcServer ¶
func RegisterGrpcServer(s grpc.ServiceRegistrar, srv GrpcServer)
Types ¶
type GrpcClient ¶
type GrpcClient interface {
Get(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
}
GrpcClient is the client API for Grpc 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 NewGrpcClient ¶
func NewGrpcClient(cc grpc.ClientConnInterface) GrpcClient
type GrpcServer ¶
type GrpcServer interface { Get(context.Context, *Request) (*Response, error) // contains filtered or unexported methods }
GrpcServer is the server API for Grpc service. All implementations must embed UnimplementedGrpcServer for forward compatibility
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
func (*Request) Descriptor
deprecated
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) ProtoReflect ¶
func (x *Request) ProtoReflect() protoreflect.Message
type Response ¶
type Response struct { Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*Response) Descriptor
deprecated
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶
func (x *Response) ProtoReflect() protoreflect.Message
type UnimplementedGrpcServer ¶
type UnimplementedGrpcServer struct { }
UnimplementedGrpcServer must be embedded to have forward compatible implementations.
type UnsafeGrpcServer ¶
type UnsafeGrpcServer interface {
// contains filtered or unexported methods
}
UnsafeGrpcServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GrpcServer will result in compilation errors.