Documentation ¶
Overview ¶
Package orderv1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterOrderServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterOrderServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client OrderServiceClient) error
- func RegisterOrderServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterOrderServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server OrderServiceServer) error
- func RegisterOrderServiceServer(s grpc.ServiceRegistrar, srv OrderServiceServer)
- type CreateOrderRequest
- func (*CreateOrderRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateOrderRequest) GetCount() int64
- func (x *CreateOrderRequest) GetProductId() int64
- func (*CreateOrderRequest) ProtoMessage()
- func (x *CreateOrderRequest) ProtoReflect() protoreflect.Message
- func (x *CreateOrderRequest) Reset()
- func (x *CreateOrderRequest) String() string
- type CreateOrderResponse
- func (*CreateOrderResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CreateOrderResponse) GetId() int64
- func (*CreateOrderResponse) ProtoMessage()
- func (x *CreateOrderResponse) ProtoReflect() protoreflect.Message
- func (x *CreateOrderResponse) Reset()
- func (x *CreateOrderResponse) String() string
- type OrderServiceClient
- type OrderServiceServer
- type UnimplementedOrderServiceServer
- type UnsafeOrderServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_order_v1_order_proto protoreflect.FileDescriptor
var OrderService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "order.v1.OrderService", HandlerType: (*OrderServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateOrder", Handler: _OrderService_CreateOrder_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "order/v1/order.proto", }
OrderService_ServiceDesc is the grpc.ServiceDesc for OrderService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterOrderServiceHandler ¶
func RegisterOrderServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterOrderServiceHandler registers the http handlers for service OrderService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterOrderServiceHandlerClient ¶
func RegisterOrderServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client OrderServiceClient) error
RegisterOrderServiceHandlerClient registers the http handlers for service OrderService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "OrderServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "OrderServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "OrderServiceClient" to call the correct interceptors.
func RegisterOrderServiceHandlerFromEndpoint ¶
func RegisterOrderServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterOrderServiceHandlerFromEndpoint is same as RegisterOrderServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterOrderServiceHandlerServer ¶
func RegisterOrderServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server OrderServiceServer) error
RegisterOrderServiceHandlerServer registers the http handlers for service OrderService to "mux". UnaryRPC :call OrderServiceServer 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 RegisterOrderServiceHandlerFromEndpoint instead.
func RegisterOrderServiceServer ¶
func RegisterOrderServiceServer(s grpc.ServiceRegistrar, srv OrderServiceServer)
Types ¶
type CreateOrderRequest ¶
type CreateOrderRequest struct { ProductId int64 `protobuf:"varint,1,opt,name=product_id,proto3" json:"product_id,omitempty"` Count int64 `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"` // contains filtered or unexported fields }
func (*CreateOrderRequest) Descriptor
deprecated
func (*CreateOrderRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateOrderRequest.ProtoReflect.Descriptor instead.
func (*CreateOrderRequest) GetCount ¶
func (x *CreateOrderRequest) GetCount() int64
func (*CreateOrderRequest) GetProductId ¶
func (x *CreateOrderRequest) GetProductId() int64
func (*CreateOrderRequest) ProtoMessage ¶
func (*CreateOrderRequest) ProtoMessage()
func (*CreateOrderRequest) ProtoReflect ¶
func (x *CreateOrderRequest) ProtoReflect() protoreflect.Message
func (*CreateOrderRequest) Reset ¶
func (x *CreateOrderRequest) Reset()
func (*CreateOrderRequest) String ¶
func (x *CreateOrderRequest) String() string
type CreateOrderResponse ¶
type CreateOrderResponse struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*CreateOrderResponse) Descriptor
deprecated
func (*CreateOrderResponse) Descriptor() ([]byte, []int)
Deprecated: Use CreateOrderResponse.ProtoReflect.Descriptor instead.
func (*CreateOrderResponse) GetId ¶
func (x *CreateOrderResponse) GetId() int64
func (*CreateOrderResponse) ProtoMessage ¶
func (*CreateOrderResponse) ProtoMessage()
func (*CreateOrderResponse) ProtoReflect ¶
func (x *CreateOrderResponse) ProtoReflect() protoreflect.Message
func (*CreateOrderResponse) Reset ¶
func (x *CreateOrderResponse) Reset()
func (*CreateOrderResponse) String ¶
func (x *CreateOrderResponse) String() string
type OrderServiceClient ¶
type OrderServiceClient interface {
CreateOrder(ctx context.Context, in *CreateOrderRequest, opts ...grpc.CallOption) (*CreateOrderResponse, error)
}
OrderServiceClient is the client API for OrderService 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 NewOrderServiceClient ¶
func NewOrderServiceClient(cc grpc.ClientConnInterface) OrderServiceClient
type OrderServiceServer ¶
type OrderServiceServer interface { CreateOrder(context.Context, *CreateOrderRequest) (*CreateOrderResponse, error) // contains filtered or unexported methods }
OrderServiceServer is the server API for OrderService service. All implementations must embed UnimplementedOrderServiceServer for forward compatibility
type UnimplementedOrderServiceServer ¶
type UnimplementedOrderServiceServer struct { }
UnimplementedOrderServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedOrderServiceServer) CreateOrder ¶
func (UnimplementedOrderServiceServer) CreateOrder(context.Context, *CreateOrderRequest) (*CreateOrderResponse, error)
type UnsafeOrderServiceServer ¶
type UnsafeOrderServiceServer interface {
// contains filtered or unexported methods
}
UnsafeOrderServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to OrderServiceServer will result in compilation errors.