Documentation ¶
Overview ¶
Package v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterGreeterServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterGreeterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GreeterServiceClient) error
- func RegisterGreeterServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterGreeterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GreeterServiceServer) error
- func RegisterGreeterServiceServer(s grpc.ServiceRegistrar, srv GreeterServiceServer)
- type GreeterServiceClient
- type GreeterServiceServer
- type GreeterService_SayStreamHelloClient
- type GreeterService_SayStreamHelloServer
- type SayHelloRequest
- type SayHelloResponse
- type SayStreamHelloRequest
- func (*SayStreamHelloRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SayStreamHelloRequest) GetName() string
- func (*SayStreamHelloRequest) ProtoMessage()
- func (x *SayStreamHelloRequest) ProtoReflect() protoreflect.Message
- func (x *SayStreamHelloRequest) Reset()
- func (x *SayStreamHelloRequest) String() string
- type SayStreamHelloResponse
- func (*SayStreamHelloResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SayStreamHelloResponse) GetMessage() string
- func (*SayStreamHelloResponse) ProtoMessage()
- func (x *SayStreamHelloResponse) ProtoReflect() protoreflect.Message
- func (x *SayStreamHelloResponse) Reset()
- func (x *SayStreamHelloResponse) String() string
- type UnimplementedGreeterServiceServer
- type UnsafeGreeterServiceServer
Constants ¶
const ( GreeterService_SayHello_FullMethodName = "/greet.v1.GreeterService/SayHello" GreeterService_SayStreamHello_FullMethodName = "/greet.v1.GreeterService/SayStreamHello" )
Variables ¶
var File_greet_v1_service_proto protoreflect.FileDescriptor
var GreeterService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "greet.v1.GreeterService", HandlerType: (*GreeterServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SayHello", Handler: _GreeterService_SayHello_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "SayStreamHello", Handler: _GreeterService_SayStreamHello_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "greet/v1/service.proto", }
GreeterService_ServiceDesc is the grpc.ServiceDesc for GreeterService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterGreeterServiceHandler ¶
func RegisterGreeterServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterGreeterServiceHandler registers the http handlers for service GreeterService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterGreeterServiceHandlerClient ¶
func RegisterGreeterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GreeterServiceClient) error
RegisterGreeterServiceHandlerClient registers the http handlers for service GreeterService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "GreeterServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "GreeterServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "GreeterServiceClient" to call the correct interceptors.
func RegisterGreeterServiceHandlerFromEndpoint ¶
func RegisterGreeterServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterGreeterServiceHandlerFromEndpoint is same as RegisterGreeterServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterGreeterServiceHandlerServer ¶
func RegisterGreeterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GreeterServiceServer) error
RegisterGreeterServiceHandlerServer registers the http handlers for service GreeterService to "mux". UnaryRPC :call GreeterServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterGreeterServiceHandlerFromEndpoint instead.
func RegisterGreeterServiceServer ¶
func RegisterGreeterServiceServer(s grpc.ServiceRegistrar, srv GreeterServiceServer)
Types ¶
type GreeterServiceClient ¶
type GreeterServiceClient interface { SayHello(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error) SayStreamHello(ctx context.Context, opts ...grpc.CallOption) (GreeterService_SayStreamHelloClient, error) }
GreeterServiceClient is the client API for GreeterService 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 NewGreeterServiceClient ¶
func NewGreeterServiceClient(cc grpc.ClientConnInterface) GreeterServiceClient
type GreeterServiceServer ¶
type GreeterServiceServer interface { SayHello(context.Context, *SayHelloRequest) (*SayHelloResponse, error) SayStreamHello(GreeterService_SayStreamHelloServer) error // contains filtered or unexported methods }
GreeterServiceServer is the server API for GreeterService service. All implementations must embed UnimplementedGreeterServiceServer for forward compatibility
type GreeterService_SayStreamHelloClient ¶
type GreeterService_SayStreamHelloClient interface { Send(*SayStreamHelloRequest) error Recv() (*SayStreamHelloResponse, error) grpc.ClientStream }
type GreeterService_SayStreamHelloServer ¶
type GreeterService_SayStreamHelloServer interface { Send(*SayStreamHelloResponse) error Recv() (*SayStreamHelloRequest, error) grpc.ServerStream }
type SayHelloRequest ¶
type SayHelloRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*SayHelloRequest) Descriptor
deprecated
func (*SayHelloRequest) Descriptor() ([]byte, []int)
Deprecated: Use SayHelloRequest.ProtoReflect.Descriptor instead.
func (*SayHelloRequest) GetName ¶
func (x *SayHelloRequest) GetName() string
func (*SayHelloRequest) ProtoMessage ¶
func (*SayHelloRequest) ProtoMessage()
func (*SayHelloRequest) ProtoReflect ¶
func (x *SayHelloRequest) ProtoReflect() protoreflect.Message
func (*SayHelloRequest) Reset ¶
func (x *SayHelloRequest) Reset()
func (*SayHelloRequest) String ¶
func (x *SayHelloRequest) String() string
type SayHelloResponse ¶
type SayHelloResponse struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*SayHelloResponse) Descriptor
deprecated
func (*SayHelloResponse) Descriptor() ([]byte, []int)
Deprecated: Use SayHelloResponse.ProtoReflect.Descriptor instead.
func (*SayHelloResponse) GetMessage ¶
func (x *SayHelloResponse) GetMessage() string
func (*SayHelloResponse) ProtoMessage ¶
func (*SayHelloResponse) ProtoMessage()
func (*SayHelloResponse) ProtoReflect ¶
func (x *SayHelloResponse) ProtoReflect() protoreflect.Message
func (*SayHelloResponse) Reset ¶
func (x *SayHelloResponse) Reset()
func (*SayHelloResponse) String ¶
func (x *SayHelloResponse) String() string
type SayStreamHelloRequest ¶
type SayStreamHelloRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*SayStreamHelloRequest) Descriptor
deprecated
func (*SayStreamHelloRequest) Descriptor() ([]byte, []int)
Deprecated: Use SayStreamHelloRequest.ProtoReflect.Descriptor instead.
func (*SayStreamHelloRequest) GetName ¶
func (x *SayStreamHelloRequest) GetName() string
func (*SayStreamHelloRequest) ProtoMessage ¶
func (*SayStreamHelloRequest) ProtoMessage()
func (*SayStreamHelloRequest) ProtoReflect ¶
func (x *SayStreamHelloRequest) ProtoReflect() protoreflect.Message
func (*SayStreamHelloRequest) Reset ¶
func (x *SayStreamHelloRequest) Reset()
func (*SayStreamHelloRequest) String ¶
func (x *SayStreamHelloRequest) String() string
type SayStreamHelloResponse ¶
type SayStreamHelloResponse struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*SayStreamHelloResponse) Descriptor
deprecated
func (*SayStreamHelloResponse) Descriptor() ([]byte, []int)
Deprecated: Use SayStreamHelloResponse.ProtoReflect.Descriptor instead.
func (*SayStreamHelloResponse) GetMessage ¶
func (x *SayStreamHelloResponse) GetMessage() string
func (*SayStreamHelloResponse) ProtoMessage ¶
func (*SayStreamHelloResponse) ProtoMessage()
func (*SayStreamHelloResponse) ProtoReflect ¶
func (x *SayStreamHelloResponse) ProtoReflect() protoreflect.Message
func (*SayStreamHelloResponse) Reset ¶
func (x *SayStreamHelloResponse) Reset()
func (*SayStreamHelloResponse) String ¶
func (x *SayStreamHelloResponse) String() string
type UnimplementedGreeterServiceServer ¶
type UnimplementedGreeterServiceServer struct { }
UnimplementedGreeterServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedGreeterServiceServer) SayHello ¶
func (UnimplementedGreeterServiceServer) SayHello(context.Context, *SayHelloRequest) (*SayHelloResponse, error)
func (UnimplementedGreeterServiceServer) SayStreamHello ¶
func (UnimplementedGreeterServiceServer) SayStreamHello(GreeterService_SayStreamHelloServer) error
type UnsafeGreeterServiceServer ¶
type UnsafeGreeterServiceServer interface {
// contains filtered or unexported methods
}
UnsafeGreeterServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GreeterServiceServer will result in compilation errors.