Documentation ¶
Overview ¶
Package orderpb is a generated protocol buffer package.
It is generated from these files:
order/orderpb/order.proto
It has these top-level messages:
Order OrderItem Shipping OrderList NewRequest GetRequest PayRequest ReturnRequest ListRequest
Index ¶
- Variables
- func RegisterOrderServiceServer(s *grpc.Server, srv OrderServiceServer)
- type GetRequest
- func (*GetRequest) Descriptor() ([]byte, []int)
- func (m *GetRequest) GetId() string
- func (m *GetRequest) Marshal() (dAtA []byte, err error)
- func (m *GetRequest) MarshalTo(dAtA []byte) (int, error)
- func (*GetRequest) ProtoMessage()
- func (m *GetRequest) Reset()
- func (m *GetRequest) Size() (n int)
- func (m *GetRequest) String() string
- func (m *GetRequest) Unmarshal(dAtA []byte) error
- type ListRequest
- func (*ListRequest) Descriptor() ([]byte, []int)
- func (m *ListRequest) GetLimit() int64
- func (m *ListRequest) GetPage() int64
- func (m *ListRequest) GetSort() ListRequest_Sort
- func (m *ListRequest) Marshal() (dAtA []byte, err error)
- func (m *ListRequest) MarshalTo(dAtA []byte) (int, error)
- func (*ListRequest) ProtoMessage()
- func (m *ListRequest) Reset()
- func (m *ListRequest) Size() (n int)
- func (m *ListRequest) String() string
- func (m *ListRequest) Unmarshal(dAtA []byte) error
- type ListRequest_Sort
- type NewRequest
- func (*NewRequest) Descriptor() ([]byte, []int)
- func (m *NewRequest) GetCurrency() paymentpb.Currency
- func (m *NewRequest) GetEmail() string
- func (m *NewRequest) GetItems() []*OrderItem
- func (m *NewRequest) GetMetadata() map[string]string
- func (m *NewRequest) GetShipping() *Shipping
- func (m *NewRequest) Marshal() (dAtA []byte, err error)
- func (m *NewRequest) MarshalTo(dAtA []byte) (int, error)
- func (*NewRequest) ProtoMessage()
- func (m *NewRequest) Reset()
- func (m *NewRequest) Size() (n int)
- func (m *NewRequest) String() string
- func (m *NewRequest) Unmarshal(dAtA []byte) error
- type Order
- func (*Order) Descriptor() ([]byte, []int)
- func (m *Order) GetAmount() int64
- func (m *Order) GetChargeId() string
- func (m *Order) GetCreated() int64
- func (m *Order) GetCurrency() paymentpb.Currency
- func (m *Order) GetEmail() string
- func (m *Order) GetId() string
- func (m *Order) GetItems() []*OrderItem
- func (m *Order) GetMetadata() map[string]string
- func (m *Order) GetShipping() *Shipping
- func (m *Order) GetStatus() OrderStatus
- func (m *Order) GetUpdated() int64
- func (m *Order) Marshal() (dAtA []byte, err error)
- func (m *Order) MarshalTo(dAtA []byte) (int, error)
- func (*Order) ProtoMessage()
- func (m *Order) Reset()
- func (m *Order) Size() (n int)
- func (m *Order) String() string
- func (m *Order) Unmarshal(dAtA []byte) error
- type OrderItem
- func (*OrderItem) Descriptor() ([]byte, []int)
- func (m *OrderItem) GetAmount() int64
- func (m *OrderItem) GetCurrency() paymentpb.Currency
- func (m *OrderItem) GetDescription() string
- func (m *OrderItem) GetParent() string
- func (m *OrderItem) GetQuantity() int64
- func (m *OrderItem) GetType() OrderItem_Type
- func (m *OrderItem) Marshal() (dAtA []byte, err error)
- func (m *OrderItem) MarshalTo(dAtA []byte) (int, error)
- func (*OrderItem) ProtoMessage()
- func (m *OrderItem) Reset()
- func (m *OrderItem) Size() (n int)
- func (m *OrderItem) String() string
- func (m *OrderItem) Unmarshal(dAtA []byte) error
- type OrderItem_Type
- type OrderList
- func (*OrderList) Descriptor() ([]byte, []int)
- func (m *OrderList) GetOrders() []*Order
- func (m *OrderList) GetTotal() int32
- func (m *OrderList) Marshal() (dAtA []byte, err error)
- func (m *OrderList) MarshalTo(dAtA []byte) (int, error)
- func (*OrderList) ProtoMessage()
- func (m *OrderList) Reset()
- func (m *OrderList) Size() (n int)
- func (m *OrderList) String() string
- func (m *OrderList) Unmarshal(dAtA []byte) error
- type OrderServiceClient
- type OrderServiceServer
- type OrderStatus
- type PayRequest
- func (*PayRequest) Descriptor() ([]byte, []int)
- func (m *PayRequest) GetCard() *paymentpb.Card
- func (m *PayRequest) GetId() string
- func (m *PayRequest) GetPaymentProviderId() paymentpb.PaymentProviderId
- func (m *PayRequest) Marshal() (dAtA []byte, err error)
- func (m *PayRequest) MarshalTo(dAtA []byte) (int, error)
- func (*PayRequest) ProtoMessage()
- func (m *PayRequest) Reset()
- func (m *PayRequest) Size() (n int)
- func (m *PayRequest) String() string
- func (m *PayRequest) Unmarshal(dAtA []byte) error
- type ReturnRequest
- func (*ReturnRequest) Descriptor() ([]byte, []int)
- func (m *ReturnRequest) GetId() string
- func (m *ReturnRequest) Marshal() (dAtA []byte, err error)
- func (m *ReturnRequest) MarshalTo(dAtA []byte) (int, error)
- func (*ReturnRequest) ProtoMessage()
- func (m *ReturnRequest) Reset()
- func (m *ReturnRequest) Size() (n int)
- func (m *ReturnRequest) String() string
- func (m *ReturnRequest) Unmarshal(dAtA []byte) error
- type Shipping
- func (*Shipping) Descriptor() ([]byte, []int)
- func (m *Shipping) GetAddress() *Shipping_Address
- func (m *Shipping) GetCarrier() string
- func (m *Shipping) GetName() string
- func (m *Shipping) GetPhone() string
- func (m *Shipping) GetTrackingNumber() string
- func (m *Shipping) Marshal() (dAtA []byte, err error)
- func (m *Shipping) MarshalTo(dAtA []byte) (int, error)
- func (*Shipping) ProtoMessage()
- func (m *Shipping) Reset()
- func (m *Shipping) Size() (n int)
- func (m *Shipping) String() string
- func (m *Shipping) Unmarshal(dAtA []byte) error
- type Shipping_Address
- func (*Shipping_Address) Descriptor() ([]byte, []int)
- func (m *Shipping_Address) GetCity() string
- func (m *Shipping_Address) GetCountry() string
- func (m *Shipping_Address) GetLine1() string
- func (m *Shipping_Address) GetLine2() string
- func (m *Shipping_Address) GetPostalCode() string
- func (m *Shipping_Address) GetState() string
- func (m *Shipping_Address) Marshal() (dAtA []byte, err error)
- func (m *Shipping_Address) MarshalTo(dAtA []byte) (int, error)
- func (*Shipping_Address) ProtoMessage()
- func (m *Shipping_Address) Reset()
- func (m *Shipping_Address) Size() (n int)
- func (m *Shipping_Address) String() string
- func (m *Shipping_Address) Unmarshal(dAtA []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidLengthOrder = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowOrder = fmt.Errorf("proto: integer overflow") )
View Source
var ListRequest_Sort_name = map[int32]string{
0: "Natural",
1: "CreatedDesc",
2: "CreatedAsc",
3: "UpdatedDesc",
4: "UpdatedAsc",
}
View Source
var ListRequest_Sort_value = map[string]int32{
"Natural": 0,
"CreatedDesc": 1,
"CreatedAsc": 2,
"UpdatedDesc": 3,
"UpdatedAsc": 4,
}
View Source
var OrderItem_Type_name = map[int32]string{
0: "reserved",
1: "sku",
2: "discount",
3: "tax",
4: "shipping",
}
View Source
var OrderItem_Type_value = map[string]int32{
"reserved": 0,
"sku": 1,
"discount": 2,
"tax": 3,
"shipping": 4,
}
View Source
var OrderStatus_name = map[int32]string{
0: "Created",
1: "Paid",
2: "Canceled",
3: "Fulfilled",
4: "Returned",
}
View Source
var OrderStatus_value = map[string]int32{
"Created": 0,
"Paid": 1,
"Canceled": 2,
"Fulfilled": 3,
"Returned": 4,
}
Functions ¶
func RegisterOrderServiceServer ¶
func RegisterOrderServiceServer(s *grpc.Server, srv OrderServiceServer)
Types ¶
type GetRequest ¶
type GetRequest struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" validate:"uuid4,required"`
}
func (*GetRequest) Descriptor ¶
func (*GetRequest) Descriptor() ([]byte, []int)
func (*GetRequest) GetId ¶
func (m *GetRequest) GetId() string
func (*GetRequest) Marshal ¶
func (m *GetRequest) Marshal() (dAtA []byte, err error)
func (*GetRequest) ProtoMessage ¶
func (*GetRequest) ProtoMessage()
func (*GetRequest) Reset ¶
func (m *GetRequest) Reset()
func (*GetRequest) Size ¶
func (m *GetRequest) Size() (n int)
func (*GetRequest) String ¶
func (m *GetRequest) String() string
func (*GetRequest) Unmarshal ¶
func (m *GetRequest) Unmarshal(dAtA []byte) error
type ListRequest ¶
type ListRequest struct { Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty" validate:"omitempty,required,gte=0"` Limit int64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty" validate:"omitempty,required,gt=0"` Sort ListRequest_Sort `` /* 134-byte string literal not displayed */ }
func (*ListRequest) Descriptor ¶
func (*ListRequest) Descriptor() ([]byte, []int)
func (*ListRequest) GetLimit ¶
func (m *ListRequest) GetLimit() int64
func (*ListRequest) GetPage ¶
func (m *ListRequest) GetPage() int64
func (*ListRequest) GetSort ¶
func (m *ListRequest) GetSort() ListRequest_Sort
func (*ListRequest) Marshal ¶
func (m *ListRequest) Marshal() (dAtA []byte, err error)
func (*ListRequest) ProtoMessage ¶
func (*ListRequest) ProtoMessage()
func (*ListRequest) Reset ¶
func (m *ListRequest) Reset()
func (*ListRequest) Size ¶
func (m *ListRequest) Size() (n int)
func (*ListRequest) String ¶
func (m *ListRequest) String() string
func (*ListRequest) Unmarshal ¶
func (m *ListRequest) Unmarshal(dAtA []byte) error
type ListRequest_Sort ¶
type ListRequest_Sort int32
const ( ListRequest_Natural ListRequest_Sort = 0 ListRequest_CreatedDesc ListRequest_Sort = 1 ListRequest_CreatedAsc ListRequest_Sort = 2 ListRequest_UpdatedDesc ListRequest_Sort = 3 ListRequest_UpdatedAsc ListRequest_Sort = 4 )
func (ListRequest_Sort) EnumDescriptor ¶
func (ListRequest_Sort) EnumDescriptor() ([]byte, []int)
func (ListRequest_Sort) String ¶
func (x ListRequest_Sort) String() string
type NewRequest ¶
type NewRequest struct { Currency paymentpb.Currency `` /* 128-byte string literal not displayed */ Items []*OrderItem `protobuf:"bytes,2,rep,name=items" json:"items,omitempty" bson:"items" validate:"dive,required"` Metadata map[string]string `` /* 150-byte string literal not displayed */ Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty" validate:"omitempty,email"` Shipping *Shipping `protobuf:"bytes,5,opt,name=shipping" json:"shipping,omitempty" validate:"omitempty,dive"` }
func (*NewRequest) Descriptor ¶
func (*NewRequest) Descriptor() ([]byte, []int)
func (*NewRequest) GetCurrency ¶
func (m *NewRequest) GetCurrency() paymentpb.Currency
func (*NewRequest) GetEmail ¶
func (m *NewRequest) GetEmail() string
func (*NewRequest) GetItems ¶
func (m *NewRequest) GetItems() []*OrderItem
func (*NewRequest) GetMetadata ¶
func (m *NewRequest) GetMetadata() map[string]string
func (*NewRequest) GetShipping ¶
func (m *NewRequest) GetShipping() *Shipping
func (*NewRequest) Marshal ¶
func (m *NewRequest) Marshal() (dAtA []byte, err error)
func (*NewRequest) ProtoMessage ¶
func (*NewRequest) ProtoMessage()
func (*NewRequest) Reset ¶
func (m *NewRequest) Reset()
func (*NewRequest) Size ¶
func (m *NewRequest) Size() (n int)
func (*NewRequest) String ¶
func (m *NewRequest) String() string
func (*NewRequest) Unmarshal ¶
func (m *NewRequest) Unmarshal(dAtA []byte) error
type Order ¶
type Order struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" bson:"_id"` Amount int64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` Currency paymentpb.Currency `protobuf:"varint,3,opt,name=currency,proto3,enum=paymentpb.Currency" json:"currency,omitempty"` Items []*OrderItem `protobuf:"bytes,4,rep,name=items" json:"items,omitempty"` Metadata map[string]string `` /* 150-byte string literal not displayed */ Email string `protobuf:"bytes,6,opt,name=email,proto3" json:"email,omitempty"` ChargeId string `protobuf:"bytes,7,opt,name=chargeId,proto3" json:"chargeId,omitempty"` Status OrderStatus `protobuf:"varint,8,opt,name=Status,proto3,enum=orderpb.OrderStatus" json:"Status,omitempty"` Shipping *Shipping `protobuf:"bytes,9,opt,name=shipping" json:"shipping,omitempty"` Created int64 `protobuf:"varint,998,opt,name=created,proto3" json:"created,omitempty"` Updated int64 `protobuf:"varint,999,opt,name=updated,proto3" json:"updated,omitempty"` }
func (*Order) Descriptor ¶
func (*Order) GetChargeId ¶
func (*Order) GetCreated ¶
func (*Order) GetCurrency ¶
func (*Order) GetMetadata ¶
func (*Order) GetShipping ¶
func (*Order) GetStatus ¶
func (m *Order) GetStatus() OrderStatus
func (*Order) GetUpdated ¶
func (*Order) ProtoMessage ¶
func (*Order) ProtoMessage()
type OrderItem ¶
type OrderItem struct { Type OrderItem_Type `protobuf:"varint,1,opt,name=type,proto3,enum=orderpb.OrderItem_Type" json:"type,omitempty" validate:"required,gte=1,lte=4"` Quantity int64 `protobuf:"varint,2,opt,name=quantity,proto3" json:"quantity,omitempty" validate:"omitempty,gte=0"` Amount int64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` Currency paymentpb.Currency `` /* 129-byte string literal not displayed */ Parent string `protobuf:"bytes,5,opt,name=parent,proto3" json:"parent,omitempty" validate:"omitempty,uuid4"` Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` }
func (*OrderItem) Descriptor ¶
func (*OrderItem) GetCurrency ¶
func (*OrderItem) GetDescription ¶
func (*OrderItem) GetQuantity ¶
func (*OrderItem) GetType ¶
func (m *OrderItem) GetType() OrderItem_Type
func (*OrderItem) ProtoMessage ¶
func (*OrderItem) ProtoMessage()
type OrderItem_Type ¶
type OrderItem_Type int32
const ( OrderItem_reserved OrderItem_Type = 0 OrderItem_sku OrderItem_Type = 1 OrderItem_discount OrderItem_Type = 2 OrderItem_tax OrderItem_Type = 3 OrderItem_shipping OrderItem_Type = 4 )
func (OrderItem_Type) EnumDescriptor ¶
func (OrderItem_Type) EnumDescriptor() ([]byte, []int)
func (OrderItem_Type) String ¶
func (x OrderItem_Type) String() string
type OrderList ¶
type OrderList struct { Orders []*Order `protobuf:"bytes,1,rep,name=orders" json:"orders,omitempty"` Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` }
func (*OrderList) Descriptor ¶
func (*OrderList) ProtoMessage ¶
func (*OrderList) ProtoMessage()
type OrderServiceClient ¶
type OrderServiceClient interface { New(ctx context.Context, in *NewRequest, opts ...grpc.CallOption) (*Order, error) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*Order, error) Pay(ctx context.Context, in *PayRequest, opts ...grpc.CallOption) (*Order, error) Return(ctx context.Context, in *ReturnRequest, opts ...grpc.CallOption) (*Order, error) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*OrderList, error) }
func NewOrderServiceClient ¶
func NewOrderServiceClient(cc *grpc.ClientConn) OrderServiceClient
type OrderServiceServer ¶
type OrderServiceServer interface { New(context.Context, *NewRequest) (*Order, error) Get(context.Context, *GetRequest) (*Order, error) Pay(context.Context, *PayRequest) (*Order, error) Return(context.Context, *ReturnRequest) (*Order, error) List(context.Context, *ListRequest) (*OrderList, error) }
type OrderStatus ¶
type OrderStatus int32
const ( Order_Created OrderStatus = 0 Order_Paid OrderStatus = 1 Order_Canceled OrderStatus = 2 Order_Fulfilled OrderStatus = 3 Order_Returned OrderStatus = 4 )
func (OrderStatus) EnumDescriptor ¶
func (OrderStatus) EnumDescriptor() ([]byte, []int)
func (OrderStatus) String ¶
func (x OrderStatus) String() string
type PayRequest ¶
type PayRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" validate:"uuid4,required"` Card *paymentpb.Card `protobuf:"bytes,2,opt,name=card" json:"card,omitempty" validate:"dive,required"` PaymentProviderId paymentpb.PaymentProviderId `` /* 153-byte string literal not displayed */ }
func (*PayRequest) Descriptor ¶
func (*PayRequest) Descriptor() ([]byte, []int)
func (*PayRequest) GetCard ¶
func (m *PayRequest) GetCard() *paymentpb.Card
func (*PayRequest) GetId ¶
func (m *PayRequest) GetId() string
func (*PayRequest) GetPaymentProviderId ¶
func (m *PayRequest) GetPaymentProviderId() paymentpb.PaymentProviderId
func (*PayRequest) Marshal ¶
func (m *PayRequest) Marshal() (dAtA []byte, err error)
func (*PayRequest) ProtoMessage ¶
func (*PayRequest) ProtoMessage()
func (*PayRequest) Reset ¶
func (m *PayRequest) Reset()
func (*PayRequest) Size ¶
func (m *PayRequest) Size() (n int)
func (*PayRequest) String ¶
func (m *PayRequest) String() string
func (*PayRequest) Unmarshal ¶
func (m *PayRequest) Unmarshal(dAtA []byte) error
type ReturnRequest ¶
type ReturnRequest struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" validate:"uuid4,required"`
}
func (*ReturnRequest) Descriptor ¶
func (*ReturnRequest) Descriptor() ([]byte, []int)
func (*ReturnRequest) GetId ¶
func (m *ReturnRequest) GetId() string
func (*ReturnRequest) Marshal ¶
func (m *ReturnRequest) Marshal() (dAtA []byte, err error)
func (*ReturnRequest) ProtoMessage ¶
func (*ReturnRequest) ProtoMessage()
func (*ReturnRequest) Reset ¶
func (m *ReturnRequest) Reset()
func (*ReturnRequest) Size ¶
func (m *ReturnRequest) Size() (n int)
func (*ReturnRequest) String ¶
func (m *ReturnRequest) String() string
func (*ReturnRequest) Unmarshal ¶
func (m *ReturnRequest) Unmarshal(dAtA []byte) error
type Shipping ¶
type Shipping struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Phone string `protobuf:"bytes,2,opt,name=phone,proto3" json:"phone,omitempty"` Address *Shipping_Address `protobuf:"bytes,3,opt,name=address" json:"address,omitempty"` Carrier string `protobuf:"bytes,4,opt,name=carrier,proto3" json:"carrier,omitempty"` TrackingNumber string `protobuf:"bytes,5,opt,name=trackingNumber,proto3" json:"trackingNumber,omitempty"` }
func (*Shipping) Descriptor ¶
func (*Shipping) GetAddress ¶
func (m *Shipping) GetAddress() *Shipping_Address
func (*Shipping) GetCarrier ¶
func (*Shipping) GetTrackingNumber ¶
func (*Shipping) ProtoMessage ¶
func (*Shipping) ProtoMessage()
type Shipping_Address ¶
type Shipping_Address struct { Line1 string `protobuf:"bytes,1,opt,name=line1,proto3" json:"line1,omitempty"` City string `protobuf:"bytes,2,opt,name=city,proto3" json:"city,omitempty"` Country string `protobuf:"bytes,3,opt,name=country,proto3" json:"country,omitempty"` Line2 string `protobuf:"bytes,4,opt,name=line2,proto3" json:"line2,omitempty"` PostalCode string `protobuf:"bytes,5,opt,name=postalCode,proto3" json:"postalCode,omitempty"` State string `protobuf:"bytes,6,opt,name=state,proto3" json:"state,omitempty"` }
func (*Shipping_Address) Descriptor ¶
func (*Shipping_Address) Descriptor() ([]byte, []int)
func (*Shipping_Address) GetCity ¶
func (m *Shipping_Address) GetCity() string
func (*Shipping_Address) GetCountry ¶
func (m *Shipping_Address) GetCountry() string
func (*Shipping_Address) GetLine1 ¶
func (m *Shipping_Address) GetLine1() string
func (*Shipping_Address) GetLine2 ¶
func (m *Shipping_Address) GetLine2() string
func (*Shipping_Address) GetPostalCode ¶
func (m *Shipping_Address) GetPostalCode() string
func (*Shipping_Address) GetState ¶
func (m *Shipping_Address) GetState() string
func (*Shipping_Address) Marshal ¶
func (m *Shipping_Address) Marshal() (dAtA []byte, err error)
func (*Shipping_Address) ProtoMessage ¶
func (*Shipping_Address) ProtoMessage()
func (*Shipping_Address) Reset ¶
func (m *Shipping_Address) Reset()
func (*Shipping_Address) Size ¶
func (m *Shipping_Address) Size() (n int)
func (*Shipping_Address) String ¶
func (m *Shipping_Address) String() string
func (*Shipping_Address) Unmarshal ¶
func (m *Shipping_Address) Unmarshal(dAtA []byte) error
Click to show internal directories.
Click to hide internal directories.