Documentation ¶
Overview ¶
Package protobuf is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterHelloServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterHelloServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HelloServiceClient) error
- func RegisterHelloServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterHelloServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HelloServiceServer) error
- func RegisterHelloServiceServer(s grpc.ServiceRegistrar, srv HelloServiceServer)
- func RegisterNotifyServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterNotifyServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NotifyServiceClient) error
- func RegisterNotifyServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterNotifyServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NotifyServiceServer) error
- func RegisterNotifyServiceServer(s grpc.ServiceRegistrar, srv NotifyServiceServer)
- type HelloServiceClient
- type HelloServiceServer
- type NotifyServiceClient
- type NotifyServiceServer
- type UnimplementedHelloServiceServer
- type UnimplementedNotifyServiceServer
- type UnsafeHelloServiceServer
- type UnsafeNotifyServiceServer
Constants ¶
const (
HelloService_GetHello_FullMethodName = "/api.protobuf.HelloService/GetHello"
)
const (
NotifyService_TransactionNotify_FullMethodName = "/api.protobuf.NotifyService/TransactionNotify"
)
Variables ¶
var File_api_protobuf_api_proto protoreflect.FileDescriptor
var HelloService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "api.protobuf.HelloService", HandlerType: (*HelloServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetHello", Handler: _HelloService_GetHello_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/protobuf/api.proto", }
HelloService_ServiceDesc is the grpc.ServiceDesc for HelloService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var NotifyService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "api.protobuf.NotifyService", HandlerType: (*NotifyServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "TransactionNotify", Handler: _NotifyService_TransactionNotify_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/protobuf/api.proto", }
NotifyService_ServiceDesc is the grpc.ServiceDesc for NotifyService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterHelloServiceHandler ¶
func RegisterHelloServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterHelloServiceHandler registers the http handlers for service HelloService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterHelloServiceHandlerClient ¶
func RegisterHelloServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HelloServiceClient) error
RegisterHelloServiceHandlerClient registers the http handlers for service HelloService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "HelloServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "HelloServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "HelloServiceClient" to call the correct interceptors.
func RegisterHelloServiceHandlerFromEndpoint ¶
func RegisterHelloServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterHelloServiceHandlerFromEndpoint is same as RegisterHelloServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterHelloServiceHandlerServer ¶
func RegisterHelloServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HelloServiceServer) error
RegisterHelloServiceHandlerServer registers the http handlers for service HelloService to "mux". UnaryRPC :call HelloServiceServer 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 RegisterHelloServiceHandlerFromEndpoint instead.
func RegisterHelloServiceServer ¶
func RegisterHelloServiceServer(s grpc.ServiceRegistrar, srv HelloServiceServer)
func RegisterNotifyServiceHandler ¶
func RegisterNotifyServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterNotifyServiceHandler registers the http handlers for service NotifyService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterNotifyServiceHandlerClient ¶
func RegisterNotifyServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NotifyServiceClient) error
RegisterNotifyServiceHandlerClient registers the http handlers for service NotifyService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "NotifyServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "NotifyServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "NotifyServiceClient" to call the correct interceptors.
func RegisterNotifyServiceHandlerFromEndpoint ¶
func RegisterNotifyServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterNotifyServiceHandlerFromEndpoint is same as RegisterNotifyServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterNotifyServiceHandlerServer ¶
func RegisterNotifyServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NotifyServiceServer) error
RegisterNotifyServiceHandlerServer registers the http handlers for service NotifyService to "mux". UnaryRPC :call NotifyServiceServer 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 RegisterNotifyServiceHandlerFromEndpoint instead.
func RegisterNotifyServiceServer ¶
func RegisterNotifyServiceServer(s grpc.ServiceRegistrar, srv NotifyServiceServer)
Types ¶
type HelloServiceClient ¶
type HelloServiceClient interface {
GetHello(ctx context.Context, in *vo.HelloRequest, opts ...grpc.CallOption) (*vo.HelloResponse, error)
}
HelloServiceClient is the client API for HelloService 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 NewHelloServiceClient ¶
func NewHelloServiceClient(cc grpc.ClientConnInterface) HelloServiceClient
type HelloServiceServer ¶
type HelloServiceServer interface { GetHello(context.Context, *vo.HelloRequest) (*vo.HelloResponse, error) // contains filtered or unexported methods }
HelloServiceServer is the server API for HelloService service. All implementations must embed UnimplementedHelloServiceServer for forward compatibility
type NotifyServiceClient ¶
type NotifyServiceClient interface {
TransactionNotify(ctx context.Context, in *vo.TransactionNotifyRequest, opts ...grpc.CallOption) (*vo.TransactionNotifyResponse, error)
}
NotifyServiceClient is the client API for NotifyService 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 NewNotifyServiceClient ¶
func NewNotifyServiceClient(cc grpc.ClientConnInterface) NotifyServiceClient
type NotifyServiceServer ¶
type NotifyServiceServer interface { TransactionNotify(context.Context, *vo.TransactionNotifyRequest) (*vo.TransactionNotifyResponse, error) // contains filtered or unexported methods }
NotifyServiceServer is the server API for NotifyService service. All implementations must embed UnimplementedNotifyServiceServer for forward compatibility
type UnimplementedHelloServiceServer ¶
type UnimplementedHelloServiceServer struct { }
UnimplementedHelloServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedHelloServiceServer) GetHello ¶
func (UnimplementedHelloServiceServer) GetHello(context.Context, *vo.HelloRequest) (*vo.HelloResponse, error)
type UnimplementedNotifyServiceServer ¶
type UnimplementedNotifyServiceServer struct { }
UnimplementedNotifyServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedNotifyServiceServer) TransactionNotify ¶
func (UnimplementedNotifyServiceServer) TransactionNotify(context.Context, *vo.TransactionNotifyRequest) (*vo.TransactionNotifyResponse, error)
type UnsafeHelloServiceServer ¶
type UnsafeHelloServiceServer interface {
// contains filtered or unexported methods
}
UnsafeHelloServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to HelloServiceServer will result in compilation errors.
type UnsafeNotifyServiceServer ¶
type UnsafeNotifyServiceServer interface {
// contains filtered or unexported methods
}
UnsafeNotifyServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to NotifyServiceServer will result in compilation errors.