Documentation ¶
Index ¶
- Variables
- func RegisterOrderServiceServer(s *grpc.Server, srv OrderServiceServer)
- type GetRequest
- type Item
- func (*Item) Descriptor() ([]byte, []int)deprecated
- func (x *Item) GetAmount() int64
- func (x *Item) GetCurrency() paymentpb.Currency
- func (x *Item) GetDescription() string
- func (x *Item) GetName() string
- func (x *Item) GetProductId() string
- func (x *Item) GetQuantity() int64
- func (x *Item) GetSensitivity() Sensitivity
- func (x *Item) GetType() ItemType
- func (*Item) ProtoMessage()
- func (x *Item) ProtoReflect() protoreflect.Message
- func (x *Item) Reset()
- func (x *Item) String() string
- type ItemType
- type NewRequest
- func (*NewRequest) Descriptor() ([]byte, []int)deprecated
- func (x *NewRequest) GetCurrency() paymentpb.Currency
- func (x *NewRequest) GetEmail() string
- func (x *NewRequest) GetItems() []*Item
- func (x *NewRequest) GetMetadata() map[string]string
- func (x *NewRequest) GetShipping() *Shipping
- func (*NewRequest) ProtoMessage()
- func (x *NewRequest) ProtoReflect() protoreflect.Message
- func (x *NewRequest) Reset()
- func (x *NewRequest) String() string
- type Order
- func (*Order) Descriptor() ([]byte, []int)deprecated
- func (x *Order) GetAmount() uint64
- func (x *Order) GetChargeId() string
- func (x *Order) GetCreated() int64
- func (x *Order) GetCurrency() paymentpb.Currency
- func (x *Order) GetCustomerId() uint64
- func (x *Order) GetDestination() string
- func (x *Order) GetId() string
- func (x *Order) GetInvoiceNumber() int64
- func (x *Order) GetItems() []*Item
- func (x *Order) GetMetadata() map[string]string
- func (x *Order) GetShipping() *Shipping
- func (x *Order) GetStatus() OrderStatus
- func (x *Order) GetUpdated() int64
- func (*Order) ProtoMessage()
- func (x *Order) ProtoReflect() protoreflect.Message
- func (x *Order) Reset()
- func (x *Order) String() string
- type OrderServiceClient
- type OrderServiceServer
- type OrderStatus
- func (OrderStatus) Descriptor() protoreflect.EnumDescriptor
- func (x OrderStatus) Enum() *OrderStatus
- func (OrderStatus) EnumDescriptor() ([]byte, []int)deprecated
- func (x OrderStatus) Number() protoreflect.EnumNumber
- func (x OrderStatus) String() string
- func (OrderStatus) Type() protoreflect.EnumType
- type PayRequest
- func (*PayRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PayRequest) GetCard() *paymentpb.Card
- func (x *PayRequest) GetPaymentProviderId() paymentpb.PaymentProviderId
- func (*PayRequest) ProtoMessage()
- func (x *PayRequest) ProtoReflect() protoreflect.Message
- func (x *PayRequest) Reset()
- func (x *PayRequest) String() string
- type ReturnRequest
- type Sensitivity
- func (Sensitivity) Descriptor() protoreflect.EnumDescriptor
- func (x Sensitivity) Enum() *Sensitivity
- func (Sensitivity) EnumDescriptor() ([]byte, []int)deprecated
- func (x Sensitivity) Number() protoreflect.EnumNumber
- func (x Sensitivity) String() string
- func (Sensitivity) Type() protoreflect.EnumType
- type Shipping
- func (*Shipping) Descriptor() ([]byte, []int)deprecated
- func (x *Shipping) GetAddress() *Shipping_Address
- func (x *Shipping) GetCarrier() string
- func (x *Shipping) GetName() string
- func (x *Shipping) GetPhone() string
- func (x *Shipping) GetTrackingNumber() string
- func (*Shipping) ProtoMessage()
- func (x *Shipping) ProtoReflect() protoreflect.Message
- func (x *Shipping) Reset()
- func (x *Shipping) String() string
- type Shipping_Address
- func (*Shipping_Address) Descriptor() ([]byte, []int)deprecated
- func (x *Shipping_Address) GetCity() string
- func (x *Shipping_Address) GetCountry() string
- func (x *Shipping_Address) GetLine1() string
- func (x *Shipping_Address) GetLine2() string
- func (x *Shipping_Address) GetPostalCode() string
- func (x *Shipping_Address) GetState() string
- func (*Shipping_Address) ProtoMessage()
- func (x *Shipping_Address) ProtoReflect() protoreflect.Message
- func (x *Shipping_Address) Reset()
- func (x *Shipping_Address) String() string
- type UnimplementedOrderServiceServer
- func (*UnimplementedOrderServiceServer) Get(context.Context, *GetRequest) (*Order, error)
- func (*UnimplementedOrderServiceServer) New(context.Context, *NewRequest) (*Order, error)
- func (*UnimplementedOrderServiceServer) Pay(context.Context, *PayRequest) (*Order, error)
- func (*UnimplementedOrderServiceServer) Return(context.Context, *ReturnRequest) (*Order, error)
Constants ¶
This section is empty.
Variables ¶
var ( OrderStatus_name = map[int32]string{ 0: "Created", 1: "Paid", 2: "Canceled", 3: "Fulfilled", 4: "Returned", } OrderStatus_value = map[string]int32{ "Created": 0, "Paid": 1, "Canceled": 2, "Fulfilled": 3, "Returned": 4, } )
Enum value maps for OrderStatus.
var ( Sensitivity_name = map[int32]string{ 0: "General", 1: "Special", 2: "Sensitive", 3: "Prohibited", } Sensitivity_value = map[string]int32{ "General": 0, "Special": 1, "Sensitive": 2, "Prohibited": 3, } )
Enum value maps for Sensitivity.
var ( ItemType_name = map[int32]string{ 0: "product", 1: "discount", 2: "tax", 3: "shipping", } ItemType_value = map[string]int32{ "product": 0, "discount": 1, "tax": 2, "shipping": 3, } )
Enum value maps for ItemType.
var File_order_orderpb_order_proto protoreflect.FileDescriptor
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"` // contains filtered or unexported fields }
func (*GetRequest) Descriptor
deprecated
func (*GetRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.
func (*GetRequest) GetId ¶
func (x *GetRequest) GetId() string
func (*GetRequest) ProtoMessage ¶
func (*GetRequest) ProtoMessage()
func (*GetRequest) ProtoReflect ¶
func (x *GetRequest) ProtoReflect() protoreflect.Message
func (*GetRequest) Reset ¶
func (x *GetRequest) Reset()
func (*GetRequest) String ¶
func (x *GetRequest) String() string
type Item ¶
type Item struct { ProductId string `protobuf:"bytes,2,opt,name=productId,proto3" json:"productId,omitempty"` Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` Quantity int64 `protobuf:"varint,4,opt,name=quantity,proto3" json:"quantity,omitempty"` Amount int64 `protobuf:"varint,5,opt,name=amount,proto3" json:"amount,omitempty"` // per item Currency paymentpb.Currency `protobuf:"varint,6,opt,name=currency,proto3,enum=paymentpb.Currency" json:"currency,omitempty"` Description string `protobuf:"bytes,7,opt,name=description,proto3" json:"description,omitempty"` Sensitivity Sensitivity `protobuf:"varint,8,opt,name=sensitivity,proto3,enum=orderpb.Sensitivity" json:"sensitivity,omitempty"` Type ItemType `protobuf:"varint,9,opt,name=type,proto3,enum=orderpb.ItemType" json:"type,omitempty"` // contains filtered or unexported fields }
func (*Item) Descriptor
deprecated
func (*Item) GetCurrency ¶
func (*Item) GetDescription ¶
func (*Item) GetProductId ¶
func (*Item) GetQuantity ¶
func (*Item) GetSensitivity ¶
func (x *Item) GetSensitivity() Sensitivity
func (*Item) ProtoMessage ¶
func (*Item) ProtoMessage()
func (*Item) ProtoReflect ¶
func (x *Item) ProtoReflect() protoreflect.Message
type ItemType ¶
type ItemType int32
func (ItemType) Descriptor ¶
func (ItemType) Descriptor() protoreflect.EnumDescriptor
func (ItemType) EnumDescriptor
deprecated
func (ItemType) Number ¶
func (x ItemType) Number() protoreflect.EnumNumber
func (ItemType) Type ¶
func (ItemType) Type() protoreflect.EnumType
type NewRequest ¶
type NewRequest struct { Currency paymentpb.Currency `protobuf:"varint,1,opt,name=currency,proto3,enum=paymentpb.Currency" json:"currency,omitempty"` Items []*Item `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` Metadata map[string]string `` /* 157-byte string literal not displayed */ Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` Shipping *Shipping `protobuf:"bytes,5,opt,name=shipping,proto3" json:"shipping,omitempty"` // contains filtered or unexported fields }
func (*NewRequest) Descriptor
deprecated
func (*NewRequest) Descriptor() ([]byte, []int)
Deprecated: Use NewRequest.ProtoReflect.Descriptor instead.
func (*NewRequest) GetCurrency ¶
func (x *NewRequest) GetCurrency() paymentpb.Currency
func (*NewRequest) GetEmail ¶
func (x *NewRequest) GetEmail() string
func (*NewRequest) GetItems ¶
func (x *NewRequest) GetItems() []*Item
func (*NewRequest) GetMetadata ¶
func (x *NewRequest) GetMetadata() map[string]string
func (*NewRequest) GetShipping ¶
func (x *NewRequest) GetShipping() *Shipping
func (*NewRequest) ProtoMessage ¶
func (*NewRequest) ProtoMessage()
func (*NewRequest) ProtoReflect ¶
func (x *NewRequest) ProtoReflect() protoreflect.Message
func (*NewRequest) Reset ¶
func (x *NewRequest) Reset()
func (*NewRequest) String ¶
func (x *NewRequest) String() string
type Order ¶
type Order struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` CustomerId uint64 `protobuf:"varint,2,opt,name=customerId,proto3" json:"customerId,omitempty"` Items []*Item `protobuf:"bytes,3,rep,name=items,proto3" json:"items,omitempty"` Amount uint64 `protobuf:"varint,4,opt,name=amount,proto3" json:"amount,omitempty"` // price amount 1000 == 10.00 Currency paymentpb.Currency `protobuf:"varint,5,opt,name=currency,proto3,enum=paymentpb.Currency" json:"currency,omitempty"` ChargeId string `protobuf:"bytes,6,opt,name=chargeId,proto3" json:"chargeId,omitempty"` Status OrderStatus `protobuf:"varint,7,opt,name=Status,proto3,enum=orderpb.OrderStatus" json:"Status,omitempty"` Shipping *Shipping `protobuf:"bytes,8,opt,name=shipping,proto3" json:"shipping,omitempty"` Destination string `protobuf:"bytes,9,opt,name=destination,proto3" json:"destination,omitempty"` Metadata map[string]string `` /* 158-byte string literal not displayed */ InvoiceNumber int64 `protobuf:"varint,11,opt,name=invoiceNumber,proto3" json:"invoiceNumber,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"` // contains filtered or unexported fields }
func (*Order) Descriptor
deprecated
func (*Order) GetChargeId ¶
func (*Order) GetCreated ¶
func (*Order) GetCurrency ¶
func (*Order) GetCustomerId ¶
func (*Order) GetDestination ¶
func (*Order) GetInvoiceNumber ¶
func (*Order) GetMetadata ¶
func (*Order) GetShipping ¶
func (*Order) GetStatus ¶
func (x *Order) GetStatus() OrderStatus
func (*Order) GetUpdated ¶
func (*Order) ProtoMessage ¶
func (*Order) ProtoMessage()
func (*Order) ProtoReflect ¶
func (x *Order) ProtoReflect() protoreflect.Message
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) }
OrderServiceClient is the client API for OrderService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewOrderServiceClient ¶
func NewOrderServiceClient(cc grpc.ClientConnInterface) 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) }
OrderServiceServer is the server API for OrderService service.
type OrderStatus ¶
type OrderStatus int32
const ( OrderStatus_Created OrderStatus = 0 OrderStatus_Paid OrderStatus = 1 OrderStatus_Canceled OrderStatus = 2 OrderStatus_Fulfilled OrderStatus = 3 OrderStatus_Returned OrderStatus = 4 )
func (OrderStatus) Descriptor ¶
func (OrderStatus) Descriptor() protoreflect.EnumDescriptor
func (OrderStatus) Enum ¶
func (x OrderStatus) Enum() *OrderStatus
func (OrderStatus) EnumDescriptor
deprecated
func (OrderStatus) EnumDescriptor() ([]byte, []int)
Deprecated: Use OrderStatus.Descriptor instead.
func (OrderStatus) Number ¶
func (x OrderStatus) Number() protoreflect.EnumNumber
func (OrderStatus) String ¶
func (x OrderStatus) String() string
func (OrderStatus) Type ¶
func (OrderStatus) Type() protoreflect.EnumType
type PayRequest ¶
type PayRequest struct { Card *paymentpb.Card `protobuf:"bytes,2,opt,name=card,proto3" json:"card,omitempty"` PaymentProviderId paymentpb.PaymentProviderId `protobuf:"varint,3,opt,name=paymentProviderId,proto3,enum=paymentpb.PaymentProviderId" json:"paymentProviderId,omitempty"` // contains filtered or unexported fields }
func (*PayRequest) Descriptor
deprecated
func (*PayRequest) Descriptor() ([]byte, []int)
Deprecated: Use PayRequest.ProtoReflect.Descriptor instead.
func (*PayRequest) GetCard ¶
func (x *PayRequest) GetCard() *paymentpb.Card
func (*PayRequest) GetPaymentProviderId ¶
func (x *PayRequest) GetPaymentProviderId() paymentpb.PaymentProviderId
func (*PayRequest) ProtoMessage ¶
func (*PayRequest) ProtoMessage()
func (*PayRequest) ProtoReflect ¶
func (x *PayRequest) ProtoReflect() protoreflect.Message
func (*PayRequest) Reset ¶
func (x *PayRequest) Reset()
func (*PayRequest) String ¶
func (x *PayRequest) String() string
type ReturnRequest ¶
type ReturnRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*ReturnRequest) Descriptor
deprecated
func (*ReturnRequest) Descriptor() ([]byte, []int)
Deprecated: Use ReturnRequest.ProtoReflect.Descriptor instead.
func (*ReturnRequest) GetId ¶
func (x *ReturnRequest) GetId() string
func (*ReturnRequest) ProtoMessage ¶
func (*ReturnRequest) ProtoMessage()
func (*ReturnRequest) ProtoReflect ¶
func (x *ReturnRequest) ProtoReflect() protoreflect.Message
func (*ReturnRequest) Reset ¶
func (x *ReturnRequest) Reset()
func (*ReturnRequest) String ¶
func (x *ReturnRequest) String() string
type Sensitivity ¶
type Sensitivity int32
const ( Sensitivity_General Sensitivity = 0 Sensitivity_Special Sensitivity = 1 Sensitivity_Sensitive Sensitivity = 2 Sensitivity_Prohibited Sensitivity = 3 )
func (Sensitivity) Descriptor ¶
func (Sensitivity) Descriptor() protoreflect.EnumDescriptor
func (Sensitivity) Enum ¶
func (x Sensitivity) Enum() *Sensitivity
func (Sensitivity) EnumDescriptor
deprecated
func (Sensitivity) EnumDescriptor() ([]byte, []int)
Deprecated: Use Sensitivity.Descriptor instead.
func (Sensitivity) Number ¶
func (x Sensitivity) Number() protoreflect.EnumNumber
func (Sensitivity) String ¶
func (x Sensitivity) String() string
func (Sensitivity) Type ¶
func (Sensitivity) Type() protoreflect.EnumType
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,proto3" 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"` // contains filtered or unexported fields }
func (*Shipping) Descriptor
deprecated
func (*Shipping) GetAddress ¶
func (x *Shipping) GetAddress() *Shipping_Address
func (*Shipping) GetCarrier ¶
func (*Shipping) GetTrackingNumber ¶
func (*Shipping) ProtoMessage ¶
func (*Shipping) ProtoMessage()
func (*Shipping) ProtoReflect ¶
func (x *Shipping) ProtoReflect() protoreflect.Message
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"` // contains filtered or unexported fields }
func (*Shipping_Address) Descriptor
deprecated
func (*Shipping_Address) Descriptor() ([]byte, []int)
Deprecated: Use Shipping_Address.ProtoReflect.Descriptor instead.
func (*Shipping_Address) GetCity ¶
func (x *Shipping_Address) GetCity() string
func (*Shipping_Address) GetCountry ¶
func (x *Shipping_Address) GetCountry() string
func (*Shipping_Address) GetLine1 ¶
func (x *Shipping_Address) GetLine1() string
func (*Shipping_Address) GetLine2 ¶
func (x *Shipping_Address) GetLine2() string
func (*Shipping_Address) GetPostalCode ¶
func (x *Shipping_Address) GetPostalCode() string
func (*Shipping_Address) GetState ¶
func (x *Shipping_Address) GetState() string
func (*Shipping_Address) ProtoMessage ¶
func (*Shipping_Address) ProtoMessage()
func (*Shipping_Address) ProtoReflect ¶
func (x *Shipping_Address) ProtoReflect() protoreflect.Message
func (*Shipping_Address) Reset ¶
func (x *Shipping_Address) Reset()
func (*Shipping_Address) String ¶
func (x *Shipping_Address) String() string
type UnimplementedOrderServiceServer ¶
type UnimplementedOrderServiceServer struct { }
UnimplementedOrderServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedOrderServiceServer) Get ¶
func (*UnimplementedOrderServiceServer) Get(context.Context, *GetRequest) (*Order, error)
func (*UnimplementedOrderServiceServer) New ¶
func (*UnimplementedOrderServiceServer) New(context.Context, *NewRequest) (*Order, error)
func (*UnimplementedOrderServiceServer) Pay ¶
func (*UnimplementedOrderServiceServer) Pay(context.Context, *PayRequest) (*Order, error)
func (*UnimplementedOrderServiceServer) Return ¶
func (*UnimplementedOrderServiceServer) Return(context.Context, *ReturnRequest) (*Order, error)