v1

package
v0.0.0-...-e6547ed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const OperationOrderCreateOrder = "/order.service.v1.Order/CreateOrder"
View Source
const OperationOrderGetConfig = "/order.service.v1.Order/GetConfig"
View Source
const OperationOrderListOrder = "/order.service.v1.Order/ListOrder"

Variables

View Source
var (
	OrderServiceErrorReason_name = map[int32]string{
		0: "UNKNOWN_ERROR",
	}
	OrderServiceErrorReason_value = map[string]int32{
		"UNKNOWN_ERROR": 0,
	}
)

Enum value maps for OrderServiceErrorReason.

View Source
var File_api_order_service_v1_order_error_proto protoreflect.FileDescriptor
View Source
var File_api_order_service_v1_order_proto protoreflect.FileDescriptor
View Source
var Order_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "order.service.v1.Order",
	HandlerType: (*OrderServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ListOrder",
			Handler:    _Order_ListOrder_Handler,
		},
		{
			MethodName: "GetConfig",
			Handler:    _Order_GetConfig_Handler,
		},
		{
			MethodName: "CreateOrder",
			Handler:    _Order_CreateOrder_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/order/service/v1/order.proto",
}

Order_ServiceDesc is the grpc.ServiceDesc for Order service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func ErrorUnknownError

func ErrorUnknownError(format string, args ...interface{}) *errors.Error

func IsUnknownError

func IsUnknownError(err error) bool

func RegisterOrderHTTPServer

func RegisterOrderHTTPServer(s *http.Server, srv OrderHTTPServer)

func RegisterOrderServer

func RegisterOrderServer(s grpc.ServiceRegistrar, srv OrderServer)

Types

type CreateOrderReply

type CreateOrderReply struct {
	OrderId int64 `protobuf:"varint,1,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` // 订单ID
	// contains filtered or unexported fields
}

func (*CreateOrderReply) Descriptor deprecated

func (*CreateOrderReply) Descriptor() ([]byte, []int)

Deprecated: Use CreateOrderReply.ProtoReflect.Descriptor instead.

func (*CreateOrderReply) GetOrderId

func (x *CreateOrderReply) GetOrderId() int64

func (*CreateOrderReply) ProtoMessage

func (*CreateOrderReply) ProtoMessage()

func (*CreateOrderReply) ProtoReflect

func (x *CreateOrderReply) ProtoReflect() protoreflect.Message

func (*CreateOrderReply) Reset

func (x *CreateOrderReply) Reset()

func (*CreateOrderReply) String

func (x *CreateOrderReply) String() string

type CreateOrderRequest

type CreateOrderRequest struct {
	ProductId int64 `protobuf:"varint,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` // 商品ID
	BuyNum    int64 `protobuf:"varint,2,opt,name=buy_num,json=buyNum,proto3" json:"buy_num,omitempty"`          // 购买数量
	// contains filtered or unexported fields
}

创建订单

func (*CreateOrderRequest) Descriptor deprecated

func (*CreateOrderRequest) Descriptor() ([]byte, []int)

Deprecated: Use CreateOrderRequest.ProtoReflect.Descriptor instead.

func (*CreateOrderRequest) GetBuyNum

func (x *CreateOrderRequest) GetBuyNum() 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 GetConfigReply

type GetConfigReply struct {
	// contains filtered or unexported fields
}

func (*GetConfigReply) Descriptor deprecated

func (*GetConfigReply) Descriptor() ([]byte, []int)

Deprecated: Use GetConfigReply.ProtoReflect.Descriptor instead.

func (*GetConfigReply) ProtoMessage

func (*GetConfigReply) ProtoMessage()

func (*GetConfigReply) ProtoReflect

func (x *GetConfigReply) ProtoReflect() protoreflect.Message

func (*GetConfigReply) Reset

func (x *GetConfigReply) Reset()

func (*GetConfigReply) String

func (x *GetConfigReply) String() string

type GetConfigRequest

type GetConfigRequest struct {
	// contains filtered or unexported fields
}

获取配置信息

func (*GetConfigRequest) Descriptor deprecated

func (*GetConfigRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetConfigRequest.ProtoReflect.Descriptor instead.

func (*GetConfigRequest) ProtoMessage

func (*GetConfigRequest) ProtoMessage()

func (*GetConfigRequest) ProtoReflect

func (x *GetConfigRequest) ProtoReflect() protoreflect.Message

func (*GetConfigRequest) Reset

func (x *GetConfigRequest) Reset()

func (*GetConfigRequest) String

func (x *GetConfigRequest) String() string

type ListOrderReply

type ListOrderReply struct {
	Orders []*ListOrderReply_Order `protobuf:"bytes,1,rep,name=orders,proto3" json:"orders,omitempty"`
	// contains filtered or unexported fields
}

func (*ListOrderReply) Descriptor deprecated

func (*ListOrderReply) Descriptor() ([]byte, []int)

Deprecated: Use ListOrderReply.ProtoReflect.Descriptor instead.

func (*ListOrderReply) GetOrders

func (x *ListOrderReply) GetOrders() []*ListOrderReply_Order

func (*ListOrderReply) ProtoMessage

func (*ListOrderReply) ProtoMessage()

func (*ListOrderReply) ProtoReflect

func (x *ListOrderReply) ProtoReflect() protoreflect.Message

func (*ListOrderReply) Reset

func (x *ListOrderReply) Reset()

func (*ListOrderReply) String

func (x *ListOrderReply) String() string

type ListOrderReply_Order

type ListOrderReply_Order struct {
	Id     int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// contains filtered or unexported fields
}

func (*ListOrderReply_Order) Descriptor deprecated

func (*ListOrderReply_Order) Descriptor() ([]byte, []int)

Deprecated: Use ListOrderReply_Order.ProtoReflect.Descriptor instead.

func (*ListOrderReply_Order) GetId

func (x *ListOrderReply_Order) GetId() int64

func (*ListOrderReply_Order) GetUserId

func (x *ListOrderReply_Order) GetUserId() int64

func (*ListOrderReply_Order) ProtoMessage

func (*ListOrderReply_Order) ProtoMessage()

func (*ListOrderReply_Order) ProtoReflect

func (x *ListOrderReply_Order) ProtoReflect() protoreflect.Message

func (*ListOrderReply_Order) Reset

func (x *ListOrderReply_Order) Reset()

func (*ListOrderReply_Order) String

func (x *ListOrderReply_Order) String() string

type ListOrderRequest

type ListOrderRequest struct {
	Uid      int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"`
	PageNum  int64 `protobuf:"varint,2,opt,name=page_num,json=pageNum,proto3" json:"page_num,omitempty"`
	PageSize int64 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	// contains filtered or unexported fields
}

获取订单列表

func (*ListOrderRequest) Descriptor deprecated

func (*ListOrderRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListOrderRequest.ProtoReflect.Descriptor instead.

func (*ListOrderRequest) GetPageNum

func (x *ListOrderRequest) GetPageNum() int64

func (*ListOrderRequest) GetPageSize

func (x *ListOrderRequest) GetPageSize() int64

func (*ListOrderRequest) GetUid

func (x *ListOrderRequest) GetUid() int64

func (*ListOrderRequest) ProtoMessage

func (*ListOrderRequest) ProtoMessage()

func (*ListOrderRequest) ProtoReflect

func (x *ListOrderRequest) ProtoReflect() protoreflect.Message

func (*ListOrderRequest) Reset

func (x *ListOrderRequest) Reset()

func (*ListOrderRequest) String

func (x *ListOrderRequest) String() string

type OrderClient

type OrderClient interface {
	// 获取订单列表
	ListOrder(ctx context.Context, in *ListOrderRequest, opts ...grpc.CallOption) (*ListOrderReply, error)
	// 读取配置信息
	GetConfig(ctx context.Context, in *GetConfigRequest, opts ...grpc.CallOption) (*GetConfigReply, error)
	// 创建订单
	CreateOrder(ctx context.Context, in *CreateOrderRequest, opts ...grpc.CallOption) (*CreateOrderReply, error)
}

OrderClient is the client API for Order 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 NewOrderClient

func NewOrderClient(cc grpc.ClientConnInterface) OrderClient

type OrderHTTPClient

type OrderHTTPClient interface {
	CreateOrder(ctx context.Context, req *CreateOrderRequest, opts ...http.CallOption) (rsp *CreateOrderReply, err error)
	GetConfig(ctx context.Context, req *GetConfigRequest, opts ...http.CallOption) (rsp *GetConfigReply, err error)
	ListOrder(ctx context.Context, req *ListOrderRequest, opts ...http.CallOption) (rsp *ListOrderReply, err error)
}

func NewOrderHTTPClient

func NewOrderHTTPClient(client *http.Client) OrderHTTPClient

type OrderHTTPClientImpl

type OrderHTTPClientImpl struct {
	// contains filtered or unexported fields
}

func (*OrderHTTPClientImpl) CreateOrder

func (*OrderHTTPClientImpl) GetConfig

func (*OrderHTTPClientImpl) ListOrder

type OrderServer

type OrderServer interface {
	// 获取订单列表
	ListOrder(context.Context, *ListOrderRequest) (*ListOrderReply, error)
	// 读取配置信息
	GetConfig(context.Context, *GetConfigRequest) (*GetConfigReply, error)
	// 创建订单
	CreateOrder(context.Context, *CreateOrderRequest) (*CreateOrderReply, error)
	// contains filtered or unexported methods
}

OrderServer is the server API for Order service. All implementations must embed UnimplementedOrderServer for forward compatibility

type OrderServiceErrorReason

type OrderServiceErrorReason int32
const (
	OrderServiceErrorReason_UNKNOWN_ERROR OrderServiceErrorReason = 0
)

func (OrderServiceErrorReason) Descriptor

func (OrderServiceErrorReason) Enum

func (OrderServiceErrorReason) EnumDescriptor deprecated

func (OrderServiceErrorReason) EnumDescriptor() ([]byte, []int)

Deprecated: Use OrderServiceErrorReason.Descriptor instead.

func (OrderServiceErrorReason) Number

func (OrderServiceErrorReason) String

func (x OrderServiceErrorReason) String() string

func (OrderServiceErrorReason) Type

type UnimplementedOrderServer

type UnimplementedOrderServer struct {
}

UnimplementedOrderServer must be embedded to have forward compatible implementations.

func (UnimplementedOrderServer) CreateOrder

func (UnimplementedOrderServer) GetConfig

func (UnimplementedOrderServer) ListOrder

type UnsafeOrderServer

type UnsafeOrderServer interface {
	// contains filtered or unexported methods
}

UnsafeOrderServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to OrderServer will result in compilation errors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL