Documentation ¶
Overview ¶
Package skupb is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterSkuServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterSkuServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SkuServiceClient) error
- func RegisterSkuServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterSkuServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SkuServiceServer) error
- func RegisterSkuServiceServer(s *grpc.Server, srv SkuServiceServer)
- type DeleteRequest
- type Empty
- type GetProductSkusRequest
- func (*GetProductSkusRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetProductSkusRequest) GetProductId() string
- func (*GetProductSkusRequest) ProtoMessage()
- func (x *GetProductSkusRequest) ProtoReflect() protoreflect.Message
- func (x *GetProductSkusRequest) Reset()
- func (x *GetProductSkusRequest) String() string
- type GetRequest
- type Inventory
- func (*Inventory) Descriptor() ([]byte, []int)deprecated
- func (x *Inventory) GetQuantity() int64
- func (x *Inventory) GetSkuId() int64
- func (x *Inventory) GetType() Inventory_Type
- func (x *Inventory) GetWarehouseId() int64
- func (*Inventory) ProtoMessage()
- func (x *Inventory) ProtoReflect() protoreflect.Message
- func (x *Inventory) Reset()
- func (x *Inventory) String() string
- type Inventory_Type
- func (Inventory_Type) Descriptor() protoreflect.EnumDescriptor
- func (x Inventory_Type) Enum() *Inventory_Type
- func (Inventory_Type) EnumDescriptor() ([]byte, []int)deprecated
- func (x Inventory_Type) Number() protoreflect.EnumNumber
- func (x Inventory_Type) String() string
- func (Inventory_Type) Type() protoreflect.EnumType
- type PackageDimensions
- func (*PackageDimensions) Descriptor() ([]byte, []int)deprecated
- func (x *PackageDimensions) GetHeight() float64
- func (x *PackageDimensions) GetLength() float64
- func (x *PackageDimensions) GetWeight() float64
- func (x *PackageDimensions) GetWidth() float64
- func (*PackageDimensions) ProtoMessage()
- func (x *PackageDimensions) ProtoReflect() protoreflect.Message
- func (x *PackageDimensions) Reset()
- func (x *PackageDimensions) String() string
- type Sku
- func (*Sku) Descriptor() ([]byte, []int)deprecated
- func (x *Sku) GetActive() bool
- func (x *Sku) GetAttributes() map[string]string
- func (x *Sku) GetCreated() int64
- func (x *Sku) GetCurrency() paymentpb.Currency
- func (x *Sku) GetDescription() string
- func (x *Sku) GetHasBattery() bool
- func (x *Sku) GetHasLiquid() bool
- func (x *Sku) GetHasSensitive() bool
- func (x *Sku) GetId() int64
- func (x *Sku) GetImage() string
- func (x *Sku) GetInventory() []*Inventory
- func (x *Sku) GetMetadata() map[string]string
- func (x *Sku) GetName() string
- func (x *Sku) GetPackageDimensions() *PackageDimensions
- func (x *Sku) GetPrice() uint64
- func (x *Sku) GetProductId() string
- func (x *Sku) GetSkuLabel() string
- func (x *Sku) GetSupplier() string
- func (x *Sku) GetUpdated() int64
- func (*Sku) ProtoMessage()
- func (x *Sku) ProtoReflect() protoreflect.Message
- func (x *Sku) Reset()
- func (x *Sku) String() string
- type SkuServiceClient
- type SkuServiceServer
- type Skus
- type UnimplementedSkuServiceServer
- func (*UnimplementedSkuServiceServer) Delete(context.Context, *DeleteRequest) (*Empty, error)
- func (*UnimplementedSkuServiceServer) Get(context.Context, *GetRequest) (*Sku, error)
- func (*UnimplementedSkuServiceServer) GetProductSkus(context.Context, *GetProductSkusRequest) (*Skus, error)
- func (*UnimplementedSkuServiceServer) New(context.Context, *UpsertRequest) (*Sku, error)
- type UpsertRequest
- func (*UpsertRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpsertRequest) GetActive() bool
- func (x *UpsertRequest) GetAttributes() map[string]string
- func (x *UpsertRequest) GetCurrency() paymentpb.Currency
- func (x *UpsertRequest) GetDescription() string
- func (x *UpsertRequest) GetHasBattery() bool
- func (x *UpsertRequest) GetHasLiquid() bool
- func (x *UpsertRequest) GetHasSensitive() bool
- func (x *UpsertRequest) GetImage() string
- func (x *UpsertRequest) GetInventory() *Inventory
- func (x *UpsertRequest) GetMetadata() map[string]string
- func (x *UpsertRequest) GetName() string
- func (x *UpsertRequest) GetPackageDimensions() *PackageDimensions
- func (x *UpsertRequest) GetPrice() uint64
- func (x *UpsertRequest) GetProductId() string
- func (x *UpsertRequest) GetSkuLabel() string
- func (x *UpsertRequest) GetSupplier() string
- func (*UpsertRequest) ProtoMessage()
- func (x *UpsertRequest) ProtoReflect() protoreflect.Message
- func (x *UpsertRequest) Reset()
- func (x *UpsertRequest) String() string
Constants ¶
This section is empty.
Variables ¶
var ( Inventory_Type_name = map[int32]string{ 0: "Infinite", 1: "Finite", } Inventory_Type_value = map[string]int32{ "Infinite": 0, "Finite": 1, } )
Enum value maps for Inventory_Type.
var File_sku_skupb_sku_proto protoreflect.FileDescriptor
Functions ¶
func RegisterSkuServiceHandler ¶
func RegisterSkuServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterSkuServiceHandler registers the http handlers for service SkuService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterSkuServiceHandlerClient ¶
func RegisterSkuServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SkuServiceClient) error
RegisterSkuServiceHandlerClient registers the http handlers for service SkuService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SkuServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SkuServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "SkuServiceClient" to call the correct interceptors.
func RegisterSkuServiceHandlerFromEndpoint ¶
func RegisterSkuServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterSkuServiceHandlerFromEndpoint is same as RegisterSkuServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterSkuServiceHandlerServer ¶
func RegisterSkuServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SkuServiceServer) error
RegisterSkuServiceHandlerServer registers the http handlers for service SkuService to "mux". UnaryRPC :call SkuServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
func RegisterSkuServiceServer ¶
func RegisterSkuServiceServer(s *grpc.Server, srv SkuServiceServer)
Types ¶
type DeleteRequest ¶
type DeleteRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*DeleteRequest) Descriptor
deprecated
func (*DeleteRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.
func (*DeleteRequest) GetName ¶
func (x *DeleteRequest) GetName() string
func (*DeleteRequest) ProtoMessage ¶
func (*DeleteRequest) ProtoMessage()
func (*DeleteRequest) ProtoReflect ¶
func (x *DeleteRequest) ProtoReflect() protoreflect.Message
func (*DeleteRequest) Reset ¶
func (x *DeleteRequest) Reset()
func (*DeleteRequest) String ¶
func (x *DeleteRequest) String() string
type Empty ¶
type Empty struct {
// contains filtered or unexported fields
}
func (*Empty) Descriptor
deprecated
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) ProtoReflect ¶
func (x *Empty) ProtoReflect() protoreflect.Message
type GetProductSkusRequest ¶
type GetProductSkusRequest struct { ProductId string `protobuf:"bytes,1,opt,name=productId,proto3" json:"productId,omitempty"` // contains filtered or unexported fields }
func (*GetProductSkusRequest) Descriptor
deprecated
func (*GetProductSkusRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetProductSkusRequest.ProtoReflect.Descriptor instead.
func (*GetProductSkusRequest) GetProductId ¶
func (x *GetProductSkusRequest) GetProductId() string
func (*GetProductSkusRequest) ProtoMessage ¶
func (*GetProductSkusRequest) ProtoMessage()
func (*GetProductSkusRequest) ProtoReflect ¶
func (x *GetProductSkusRequest) ProtoReflect() protoreflect.Message
func (*GetProductSkusRequest) Reset ¶
func (x *GetProductSkusRequest) Reset()
func (*GetProductSkusRequest) String ¶
func (x *GetProductSkusRequest) String() string
type GetRequest ¶
type GetRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*GetRequest) Descriptor
deprecated
func (*GetRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.
func (*GetRequest) GetName ¶
func (x *GetRequest) GetName() 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 Inventory ¶
type Inventory struct { SkuId int64 `protobuf:"varint,1,opt,name=skuId,proto3" json:"skuId,omitempty"` WarehouseId int64 `protobuf:"varint,2,opt,name=warehouseId,proto3" json:"warehouseId,omitempty"` Quantity int64 `protobuf:"varint,3,opt,name=quantity,proto3" json:"quantity,omitempty"` // available quantity Type Inventory_Type `protobuf:"varint,4,opt,name=type,proto3,enum=skupb.Inventory_Type" json:"type,omitempty"` // contains filtered or unexported fields }
func (*Inventory) Descriptor
deprecated
func (*Inventory) GetQuantity ¶
func (*Inventory) GetType ¶
func (x *Inventory) GetType() Inventory_Type
func (*Inventory) GetWarehouseId ¶
func (*Inventory) ProtoMessage ¶
func (*Inventory) ProtoMessage()
func (*Inventory) ProtoReflect ¶
func (x *Inventory) ProtoReflect() protoreflect.Message
type Inventory_Type ¶
type Inventory_Type int32
const ( Inventory_Infinite Inventory_Type = 0 Inventory_Finite Inventory_Type = 1 )
func (Inventory_Type) Descriptor ¶
func (Inventory_Type) Descriptor() protoreflect.EnumDescriptor
func (Inventory_Type) Enum ¶
func (x Inventory_Type) Enum() *Inventory_Type
func (Inventory_Type) EnumDescriptor
deprecated
func (Inventory_Type) EnumDescriptor() ([]byte, []int)
Deprecated: Use Inventory_Type.Descriptor instead.
func (Inventory_Type) Number ¶
func (x Inventory_Type) Number() protoreflect.EnumNumber
func (Inventory_Type) String ¶
func (x Inventory_Type) String() string
func (Inventory_Type) Type ¶
func (Inventory_Type) Type() protoreflect.EnumType
type PackageDimensions ¶
type PackageDimensions struct { Height float64 `protobuf:"fixed64,1,opt,name=height,proto3" json:"height,omitempty"` Length float64 `protobuf:"fixed64,2,opt,name=length,proto3" json:"length,omitempty"` Weight float64 `protobuf:"fixed64,3,opt,name=weight,proto3" json:"weight,omitempty"` Width float64 `protobuf:"fixed64,4,opt,name=width,proto3" json:"width,omitempty"` // contains filtered or unexported fields }
func (*PackageDimensions) Descriptor
deprecated
func (*PackageDimensions) Descriptor() ([]byte, []int)
Deprecated: Use PackageDimensions.ProtoReflect.Descriptor instead.
func (*PackageDimensions) GetHeight ¶
func (x *PackageDimensions) GetHeight() float64
func (*PackageDimensions) GetLength ¶
func (x *PackageDimensions) GetLength() float64
func (*PackageDimensions) GetWeight ¶
func (x *PackageDimensions) GetWeight() float64
func (*PackageDimensions) GetWidth ¶
func (x *PackageDimensions) GetWidth() float64
func (*PackageDimensions) ProtoMessage ¶
func (*PackageDimensions) ProtoMessage()
func (*PackageDimensions) ProtoReflect ¶
func (x *PackageDimensions) ProtoReflect() protoreflect.Message
func (*PackageDimensions) Reset ¶
func (x *PackageDimensions) Reset()
func (*PackageDimensions) String ¶
func (x *PackageDimensions) String() string
type Sku ¶
type Sku struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Price uint64 `protobuf:"varint,3,opt,name=price,proto3" json:"price,omitempty"` // dollar Currency paymentpb.Currency `protobuf:"varint,4,opt,name=currency,proto3,enum=paymentpb.Currency" json:"currency,omitempty"` Active bool `protobuf:"varint,5,opt,name=active,proto3" json:"active,omitempty"` ProductId string `protobuf:"bytes,6,opt,name=productId,proto3" json:"productId,omitempty"` Metadata map[string]string `` /* 157-byte string literal not displayed */ Attributes map[string]string `` /* 161-byte string literal not displayed */ Image string `protobuf:"bytes,9,opt,name=image,proto3" json:"image,omitempty"` PackageDimensions *PackageDimensions `protobuf:"bytes,10,opt,name=packageDimensions,proto3" json:"packageDimensions,omitempty"` Inventory []*Inventory `protobuf:"bytes,11,rep,name=inventory,proto3" json:"inventory,omitempty"` HasBattery bool `protobuf:"varint,12,opt,name=hasBattery,proto3" json:"hasBattery,omitempty"` HasLiquid bool `protobuf:"varint,13,opt,name=hasLiquid,proto3" json:"hasLiquid,omitempty"` HasSensitive bool `protobuf:"varint,14,opt,name=hasSensitive,proto3" json:"hasSensitive,omitempty"` Description string `protobuf:"bytes,15,opt,name=description,proto3" json:"description,omitempty"` SkuLabel string `protobuf:"bytes,16,opt,name=skuLabel,proto3" json:"skuLabel,omitempty"` Supplier string `protobuf:"bytes,17,opt,name=supplier,proto3" json:"supplier,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 (*Sku) Descriptor
deprecated
func (*Sku) GetAttributes ¶
func (*Sku) GetCreated ¶
func (*Sku) GetCurrency ¶
func (*Sku) GetDescription ¶
func (*Sku) GetHasBattery ¶
func (*Sku) GetHasLiquid ¶
func (*Sku) GetHasSensitive ¶
func (*Sku) GetInventory ¶
func (*Sku) GetMetadata ¶
func (*Sku) GetPackageDimensions ¶
func (x *Sku) GetPackageDimensions() *PackageDimensions
func (*Sku) GetProductId ¶
func (*Sku) GetSkuLabel ¶
func (*Sku) GetSupplier ¶
func (*Sku) GetUpdated ¶
func (*Sku) ProtoMessage ¶
func (*Sku) ProtoMessage()
func (*Sku) ProtoReflect ¶
func (x *Sku) ProtoReflect() protoreflect.Message
type SkuServiceClient ¶
type SkuServiceClient interface { New(ctx context.Context, in *UpsertRequest, opts ...grpc.CallOption) (*Sku, error) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*Sku, error) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*Empty, error) GetProductSkus(ctx context.Context, in *GetProductSkusRequest, opts ...grpc.CallOption) (*Skus, error) }
SkuServiceClient is the client API for SkuService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewSkuServiceClient ¶
func NewSkuServiceClient(cc grpc.ClientConnInterface) SkuServiceClient
type SkuServiceServer ¶
type SkuServiceServer interface { New(context.Context, *UpsertRequest) (*Sku, error) Get(context.Context, *GetRequest) (*Sku, error) Delete(context.Context, *DeleteRequest) (*Empty, error) GetProductSkus(context.Context, *GetProductSkusRequest) (*Skus, error) }
SkuServiceServer is the cfg API for SkuService service.
type Skus ¶
type Skus struct { Skus []*Sku `protobuf:"bytes,1,rep,name=skus,proto3" json:"skus,omitempty"` // contains filtered or unexported fields }
func (*Skus) Descriptor
deprecated
func (*Skus) ProtoMessage ¶
func (*Skus) ProtoMessage()
func (*Skus) ProtoReflect ¶
func (x *Skus) ProtoReflect() protoreflect.Message
type UnimplementedSkuServiceServer ¶
type UnimplementedSkuServiceServer struct { }
UnimplementedSkuServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedSkuServiceServer) Delete ¶
func (*UnimplementedSkuServiceServer) Delete(context.Context, *DeleteRequest) (*Empty, error)
func (*UnimplementedSkuServiceServer) Get ¶
func (*UnimplementedSkuServiceServer) Get(context.Context, *GetRequest) (*Sku, error)
func (*UnimplementedSkuServiceServer) GetProductSkus ¶
func (*UnimplementedSkuServiceServer) GetProductSkus(context.Context, *GetProductSkusRequest) (*Skus, error)
func (*UnimplementedSkuServiceServer) New ¶
func (*UnimplementedSkuServiceServer) New(context.Context, *UpsertRequest) (*Sku, error)
type UpsertRequest ¶
type UpsertRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Currency paymentpb.Currency `protobuf:"varint,2,opt,name=currency,proto3,enum=paymentpb.Currency" json:"currency,omitempty"` Active bool `protobuf:"varint,3,opt,name=active,proto3" json:"active,omitempty"` ProductId string `protobuf:"bytes,4,opt,name=productId,proto3" json:"productId,omitempty"` Price uint64 `protobuf:"varint,5,opt,name=price,proto3" json:"price,omitempty"` Metadata map[string]string `` /* 157-byte string literal not displayed */ Image string `protobuf:"bytes,7,opt,name=image,proto3" json:"image,omitempty"` SkuLabel string `protobuf:"bytes,8,opt,name=skuLabel,proto3" json:"skuLabel,omitempty"` PackageDimensions *PackageDimensions `protobuf:"bytes,9,opt,name=packageDimensions,proto3" json:"packageDimensions,omitempty"` Inventory *Inventory `protobuf:"bytes,10,opt,name=inventory,proto3" json:"inventory,omitempty"` Attributes map[string]string `` /* 162-byte string literal not displayed */ HasBattery bool `protobuf:"varint,12,opt,name=hasBattery,proto3" json:"hasBattery,omitempty"` HasLiquid bool `protobuf:"varint,13,opt,name=hasLiquid,proto3" json:"hasLiquid,omitempty"` HasSensitive bool `protobuf:"varint,14,opt,name=hasSensitive,proto3" json:"hasSensitive,omitempty"` Description string `protobuf:"bytes,15,opt,name=description,proto3" json:"description,omitempty"` Supplier string `protobuf:"bytes,16,opt,name=supplier,proto3" json:"supplier,omitempty"` // contains filtered or unexported fields }
func (*UpsertRequest) Descriptor
deprecated
func (*UpsertRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpsertRequest.ProtoReflect.Descriptor instead.
func (*UpsertRequest) GetActive ¶
func (x *UpsertRequest) GetActive() bool
func (*UpsertRequest) GetAttributes ¶
func (x *UpsertRequest) GetAttributes() map[string]string
func (*UpsertRequest) GetCurrency ¶
func (x *UpsertRequest) GetCurrency() paymentpb.Currency
func (*UpsertRequest) GetDescription ¶
func (x *UpsertRequest) GetDescription() string
func (*UpsertRequest) GetHasBattery ¶
func (x *UpsertRequest) GetHasBattery() bool
func (*UpsertRequest) GetHasLiquid ¶
func (x *UpsertRequest) GetHasLiquid() bool
func (*UpsertRequest) GetHasSensitive ¶
func (x *UpsertRequest) GetHasSensitive() bool
func (*UpsertRequest) GetImage ¶
func (x *UpsertRequest) GetImage() string
func (*UpsertRequest) GetInventory ¶
func (x *UpsertRequest) GetInventory() *Inventory
func (*UpsertRequest) GetMetadata ¶
func (x *UpsertRequest) GetMetadata() map[string]string
func (*UpsertRequest) GetName ¶
func (x *UpsertRequest) GetName() string
func (*UpsertRequest) GetPackageDimensions ¶
func (x *UpsertRequest) GetPackageDimensions() *PackageDimensions
func (*UpsertRequest) GetPrice ¶
func (x *UpsertRequest) GetPrice() uint64
func (*UpsertRequest) GetProductId ¶
func (x *UpsertRequest) GetProductId() string
func (*UpsertRequest) GetSkuLabel ¶
func (x *UpsertRequest) GetSkuLabel() string
func (*UpsertRequest) GetSupplier ¶
func (x *UpsertRequest) GetSupplier() string
func (*UpsertRequest) ProtoMessage ¶
func (*UpsertRequest) ProtoMessage()
func (*UpsertRequest) ProtoReflect ¶
func (x *UpsertRequest) ProtoReflect() protoreflect.Message
func (*UpsertRequest) Reset ¶
func (x *UpsertRequest) Reset()
func (*UpsertRequest) String ¶
func (x *UpsertRequest) String() string