Documentation ¶
Overview ¶
Package order 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) GetOrder() *Order
- func (*CreateOrderRequest) ProtoMessage()
- func (x *CreateOrderRequest) ProtoReflect() protoreflect.Message
- func (x *CreateOrderRequest) Reset()
- func (x *CreateOrderRequest) SetOrder(v *Order)
- func (x *CreateOrderRequest) String() string
- type DeleteOrderRequest
- func (*DeleteOrderRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteOrderRequest) GetName() string
- func (*DeleteOrderRequest) ProtoMessage()
- func (x *DeleteOrderRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteOrderRequest) Reset()
- func (x *DeleteOrderRequest) SetName(v string)
- func (x *DeleteOrderRequest) String() string
- type GetOrderRequest
- func (*GetOrderRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetOrderRequest) GetName() string
- func (*GetOrderRequest) ProtoMessage()
- func (x *GetOrderRequest) ProtoReflect() protoreflect.Message
- func (x *GetOrderRequest) Reset()
- func (x *GetOrderRequest) SetName(v string)
- func (x *GetOrderRequest) String() string
- type ListOrdersRequest
- func (*ListOrdersRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListOrdersRequest) GetPageNumber() int32
- func (x *ListOrdersRequest) GetPageSize() int32
- func (*ListOrdersRequest) ProtoMessage()
- func (x *ListOrdersRequest) ProtoReflect() protoreflect.Message
- func (x *ListOrdersRequest) Reset()
- func (x *ListOrdersRequest) SetPageNumber(v int32)
- func (x *ListOrdersRequest) SetPageSize(v int32)
- func (x *ListOrdersRequest) String() string
- type ListOrdersResponse
- func (*ListOrdersResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListOrdersResponse) GetCount() int32
- func (x *ListOrdersResponse) GetOrders() []*Order
- func (*ListOrdersResponse) ProtoMessage()
- func (x *ListOrdersResponse) ProtoReflect() protoreflect.Message
- func (x *ListOrdersResponse) Reset()
- func (x *ListOrdersResponse) SetCount(v int32)
- func (x *ListOrdersResponse) SetOrders(v []*Order)
- func (x *ListOrdersResponse) String() string
- type Order
- func (*Order) Descriptor() ([]byte, []int)deprecated
- func (x *Order) GetCreateTime() *timestamppb.Timestamp
- func (x *Order) GetId() int64
- func (x *Order) GetName() string
- func (x *Order) GetPrice() float32
- func (x *Order) GetUpdateTime() *timestamppb.Timestamp
- func (*Order) ProtoMessage()
- func (x *Order) ProtoReflect() protoreflect.Message
- func (x *Order) Reset()
- func (x *Order) SetCreateTime(v *timestamppb.Timestamp)
- func (x *Order) SetId(v int64)
- func (x *Order) SetName(v string)
- func (x *Order) SetPrice(v float32)
- func (x *Order) SetUpdateTime(v *timestamppb.Timestamp)
- func (x *Order) String() string
- type OrderServiceClient
- type OrderServiceServer
- type UnimplementedOrderServiceServer
- func (UnimplementedOrderServiceServer) CreateOrder(context.Context, *CreateOrderRequest) (*Order, error)
- func (UnimplementedOrderServiceServer) DeleteBook(context.Context, *DeleteOrderRequest) (*emptypb.Empty, error)
- func (UnimplementedOrderServiceServer) GetOrder(context.Context, *GetOrderRequest) (*Order, error)
- func (UnimplementedOrderServiceServer) ListOrders(context.Context, *ListOrdersRequest) (*ListOrdersResponse, error)
- func (UnimplementedOrderServiceServer) UpdateOrder(context.Context, *UpdateOrderRequest) (*emptypb.Empty, error)
- type UnsafeOrderServiceServer
- type UpdateOrderRequest
- func (*UpdateOrderRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateOrderRequest) GetOrder() *Order
- func (x *UpdateOrderRequest) GetUpdateMask() *fieldmaskpb.FieldMask
- func (*UpdateOrderRequest) ProtoMessage()
- func (x *UpdateOrderRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateOrderRequest) Reset()
- func (x *UpdateOrderRequest) SetOrder(v *Order)
- func (x *UpdateOrderRequest) SetUpdateMask(v *fieldmaskpb.FieldMask)
- func (x *UpdateOrderRequest) String() string
Constants ¶
This section is empty.
Variables ¶
var File_idl_order_order_proto protoreflect.FileDescriptor
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 { Order *Order `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"` // contains filtered or unexported fields }
func (*CreateOrderRequest) Descriptor
deprecated
func (*CreateOrderRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateOrderRequest.ProtoReflect.Descriptor instead.
func (*CreateOrderRequest) GetOrder ¶
func (x *CreateOrderRequest) GetOrder() *Order
func (*CreateOrderRequest) ProtoMessage ¶
func (*CreateOrderRequest) ProtoMessage()
func (*CreateOrderRequest) ProtoReflect ¶
func (x *CreateOrderRequest) ProtoReflect() protoreflect.Message
func (*CreateOrderRequest) Reset ¶
func (x *CreateOrderRequest) Reset()
func (*CreateOrderRequest) SetOrder ¶ added in v0.7.0
func (x *CreateOrderRequest) SetOrder(v *Order)
func (*CreateOrderRequest) String ¶
func (x *CreateOrderRequest) String() string
type DeleteOrderRequest ¶ added in v0.5.2
type DeleteOrderRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name"` // contains filtered or unexported fields }
func (*DeleteOrderRequest) Descriptor
deprecated
added in
v0.5.2
func (*DeleteOrderRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteOrderRequest.ProtoReflect.Descriptor instead.
func (*DeleteOrderRequest) GetName ¶ added in v0.5.2
func (x *DeleteOrderRequest) GetName() string
func (*DeleteOrderRequest) ProtoMessage ¶ added in v0.5.2
func (*DeleteOrderRequest) ProtoMessage()
func (*DeleteOrderRequest) ProtoReflect ¶ added in v0.5.2
func (x *DeleteOrderRequest) ProtoReflect() protoreflect.Message
func (*DeleteOrderRequest) Reset ¶ added in v0.5.2
func (x *DeleteOrderRequest) Reset()
func (*DeleteOrderRequest) SetName ¶ added in v0.7.0
func (x *DeleteOrderRequest) SetName(v string)
func (*DeleteOrderRequest) String ¶ added in v0.5.2
func (x *DeleteOrderRequest) String() string
type GetOrderRequest ¶
type GetOrderRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name"` // contains filtered or unexported fields }
func (*GetOrderRequest) Descriptor
deprecated
func (*GetOrderRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetOrderRequest.ProtoReflect.Descriptor instead.
func (*GetOrderRequest) GetName ¶
func (x *GetOrderRequest) GetName() string
func (*GetOrderRequest) ProtoMessage ¶
func (*GetOrderRequest) ProtoMessage()
func (*GetOrderRequest) ProtoReflect ¶
func (x *GetOrderRequest) ProtoReflect() protoreflect.Message
func (*GetOrderRequest) Reset ¶
func (x *GetOrderRequest) Reset()
func (*GetOrderRequest) SetName ¶ added in v0.7.0
func (x *GetOrderRequest) SetName(v string)
func (*GetOrderRequest) String ¶
func (x *GetOrderRequest) String() string
type ListOrdersRequest ¶
type ListOrdersRequest struct { PageNumber int32 `protobuf:"varint,1,opt,name=page_number,json=pageNumber,proto3" json:"page_number"` PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size"` // contains filtered or unexported fields }
func (*ListOrdersRequest) Descriptor
deprecated
func (*ListOrdersRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListOrdersRequest.ProtoReflect.Descriptor instead.
func (*ListOrdersRequest) GetPageNumber ¶
func (x *ListOrdersRequest) GetPageNumber() int32
func (*ListOrdersRequest) GetPageSize ¶
func (x *ListOrdersRequest) GetPageSize() int32
func (*ListOrdersRequest) ProtoMessage ¶
func (*ListOrdersRequest) ProtoMessage()
func (*ListOrdersRequest) ProtoReflect ¶
func (x *ListOrdersRequest) ProtoReflect() protoreflect.Message
func (*ListOrdersRequest) Reset ¶
func (x *ListOrdersRequest) Reset()
func (*ListOrdersRequest) SetPageNumber ¶ added in v0.7.0
func (x *ListOrdersRequest) SetPageNumber(v int32)
func (*ListOrdersRequest) SetPageSize ¶ added in v0.7.0
func (x *ListOrdersRequest) SetPageSize(v int32)
func (*ListOrdersRequest) String ¶
func (x *ListOrdersRequest) String() string
type ListOrdersResponse ¶
type ListOrdersResponse struct { Orders []*Order `protobuf:"bytes,1,rep,name=orders,proto3" json:"orders"` Count int32 `protobuf:"varint,2,opt,name=count,proto3" json:"count"` // contains filtered or unexported fields }
func (*ListOrdersResponse) Descriptor
deprecated
func (*ListOrdersResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListOrdersResponse.ProtoReflect.Descriptor instead.
func (*ListOrdersResponse) GetCount ¶
func (x *ListOrdersResponse) GetCount() int32
func (*ListOrdersResponse) GetOrders ¶
func (x *ListOrdersResponse) GetOrders() []*Order
func (*ListOrdersResponse) ProtoMessage ¶
func (*ListOrdersResponse) ProtoMessage()
func (*ListOrdersResponse) ProtoReflect ¶
func (x *ListOrdersResponse) ProtoReflect() protoreflect.Message
func (*ListOrdersResponse) Reset ¶
func (x *ListOrdersResponse) Reset()
func (*ListOrdersResponse) SetCount ¶ added in v0.7.0
func (x *ListOrdersResponse) SetCount(v int32)
func (*ListOrdersResponse) SetOrders ¶ added in v0.7.0
func (x *ListOrdersResponse) SetOrders(v []*Order)
func (*ListOrdersResponse) String ¶
func (x *ListOrdersResponse) String() string
type Order ¶
type Order struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name"` Price float32 `protobuf:"fixed32,3,opt,name=price,proto3" json:"price"` CreateTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` UpdateTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` // contains filtered or unexported fields }
func (*Order) Descriptor
deprecated
func (*Order) GetCreateTime ¶ added in v0.5.2
func (x *Order) GetCreateTime() *timestamppb.Timestamp
func (*Order) GetUpdateTime ¶ added in v0.5.2
func (x *Order) GetUpdateTime() *timestamppb.Timestamp
func (*Order) ProtoMessage ¶
func (*Order) ProtoMessage()
func (*Order) ProtoReflect ¶
func (x *Order) ProtoReflect() protoreflect.Message
func (*Order) SetCreateTime ¶ added in v0.7.0
func (x *Order) SetCreateTime(v *timestamppb.Timestamp)
func (*Order) SetUpdateTime ¶ added in v0.7.0
func (x *Order) SetUpdateTime(v *timestamppb.Timestamp)
type OrderServiceClient ¶
type OrderServiceClient interface { ListOrders(ctx context.Context, in *ListOrdersRequest, opts ...grpc.CallOption) (*ListOrdersResponse, error) CreateOrder(ctx context.Context, in *CreateOrderRequest, opts ...grpc.CallOption) (*Order, error) UpdateOrder(ctx context.Context, in *UpdateOrderRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) GetOrder(ctx context.Context, in *GetOrderRequest, opts ...grpc.CallOption) (*Order, error) DeleteBook(ctx context.Context, in *DeleteOrderRequest, opts ...grpc.CallOption) (*emptypb.Empty, 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 { ListOrders(context.Context, *ListOrdersRequest) (*ListOrdersResponse, error) CreateOrder(context.Context, *CreateOrderRequest) (*Order, error) UpdateOrder(context.Context, *UpdateOrderRequest) (*emptypb.Empty, error) GetOrder(context.Context, *GetOrderRequest) (*Order, error) DeleteBook(context.Context, *DeleteOrderRequest) (*emptypb.Empty, 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) (*Order, error)
func (UnimplementedOrderServiceServer) DeleteBook ¶
func (UnimplementedOrderServiceServer) DeleteBook(context.Context, *DeleteOrderRequest) (*emptypb.Empty, error)
func (UnimplementedOrderServiceServer) GetOrder ¶
func (UnimplementedOrderServiceServer) GetOrder(context.Context, *GetOrderRequest) (*Order, error)
func (UnimplementedOrderServiceServer) ListOrders ¶
func (UnimplementedOrderServiceServer) ListOrders(context.Context, *ListOrdersRequest) (*ListOrdersResponse, error)
func (UnimplementedOrderServiceServer) UpdateOrder ¶
func (UnimplementedOrderServiceServer) UpdateOrder(context.Context, *UpdateOrderRequest) (*emptypb.Empty, 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.
type UpdateOrderRequest ¶
type UpdateOrderRequest struct { Order *Order `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"` UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` // contains filtered or unexported fields }
func (*UpdateOrderRequest) Descriptor
deprecated
func (*UpdateOrderRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateOrderRequest.ProtoReflect.Descriptor instead.
func (*UpdateOrderRequest) GetOrder ¶
func (x *UpdateOrderRequest) GetOrder() *Order
func (*UpdateOrderRequest) GetUpdateMask ¶
func (x *UpdateOrderRequest) GetUpdateMask() *fieldmaskpb.FieldMask
func (*UpdateOrderRequest) ProtoMessage ¶
func (*UpdateOrderRequest) ProtoMessage()
func (*UpdateOrderRequest) ProtoReflect ¶
func (x *UpdateOrderRequest) ProtoReflect() protoreflect.Message
func (*UpdateOrderRequest) Reset ¶
func (x *UpdateOrderRequest) Reset()
func (*UpdateOrderRequest) SetOrder ¶ added in v0.7.0
func (x *UpdateOrderRequest) SetOrder(v *Order)
func (*UpdateOrderRequest) SetUpdateMask ¶ added in v0.7.0
func (x *UpdateOrderRequest) SetUpdateMask(v *fieldmaskpb.FieldMask)
func (*UpdateOrderRequest) String ¶
func (x *UpdateOrderRequest) String() string