skupb

package
v0.0.0-...-4867541 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package skupb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

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

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Inventory.ProtoReflect.Descriptor instead.

func (*Inventory) GetQuantity

func (x *Inventory) GetQuantity() int64

func (*Inventory) GetSkuId

func (x *Inventory) GetSkuId() int64

func (*Inventory) GetType

func (x *Inventory) GetType() Inventory_Type

func (*Inventory) GetWarehouseId

func (x *Inventory) GetWarehouseId() int64

func (*Inventory) ProtoMessage

func (*Inventory) ProtoMessage()

func (*Inventory) ProtoReflect

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

func (*Inventory) Reset

func (x *Inventory) Reset()

func (*Inventory) String

func (x *Inventory) String() string

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) 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 (Inventory_Type) String

func (x Inventory_Type) String() string

func (Inventory_Type) Type

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) Descriptor() ([]byte, []int)

Deprecated: Use Sku.ProtoReflect.Descriptor instead.

func (*Sku) GetActive

func (x *Sku) GetActive() bool

func (*Sku) GetAttributes

func (x *Sku) GetAttributes() map[string]string

func (*Sku) GetCreated

func (x *Sku) GetCreated() int64

func (*Sku) GetCurrency

func (x *Sku) GetCurrency() paymentpb.Currency

func (*Sku) GetDescription

func (x *Sku) GetDescription() string

func (*Sku) GetHasBattery

func (x *Sku) GetHasBattery() bool

func (*Sku) GetHasLiquid

func (x *Sku) GetHasLiquid() bool

func (*Sku) GetHasSensitive

func (x *Sku) GetHasSensitive() bool

func (*Sku) GetId

func (x *Sku) GetId() int64

func (*Sku) GetImage

func (x *Sku) GetImage() string

func (*Sku) GetInventory

func (x *Sku) GetInventory() []*Inventory

func (*Sku) GetMetadata

func (x *Sku) GetMetadata() map[string]string

func (*Sku) GetName

func (x *Sku) GetName() string

func (*Sku) GetPackageDimensions

func (x *Sku) GetPackageDimensions() *PackageDimensions

func (*Sku) GetPrice

func (x *Sku) GetPrice() uint64

func (*Sku) GetProductId

func (x *Sku) GetProductId() string

func (*Sku) GetSkuLabel

func (x *Sku) GetSkuLabel() string

func (*Sku) GetSupplier

func (x *Sku) GetSupplier() string

func (*Sku) GetUpdated

func (x *Sku) GetUpdated() int64

func (*Sku) ProtoMessage

func (*Sku) ProtoMessage()

func (*Sku) ProtoReflect

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

func (*Sku) Reset

func (x *Sku) Reset()

func (*Sku) String

func (x *Sku) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Skus.ProtoReflect.Descriptor instead.

func (*Skus) GetSkus

func (x *Skus) GetSkus() []*Sku

func (*Skus) ProtoMessage

func (*Skus) ProtoMessage()

func (*Skus) ProtoReflect

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

func (*Skus) Reset

func (x *Skus) Reset()

func (*Skus) String

func (x *Skus) String() string

type UnimplementedSkuServiceServer

type UnimplementedSkuServiceServer struct {
}

UnimplementedSkuServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedSkuServiceServer) Delete

func (*UnimplementedSkuServiceServer) Get

func (*UnimplementedSkuServiceServer) GetProductSkus

func (*UnimplementedSkuServiceServer) New

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

Jump to

Keyboard shortcuts

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