inventory

package
v0.0.0-...-bfe867e Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package inventory is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_demo_inventory_product_proto protoreflect.FileDescriptor
View Source
var File_demo_inventory_service_proto protoreflect.FileDescriptor

Functions

func RegisterProductsServiceHandler

func RegisterProductsServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterProductsServiceHandler registers the http handlers for service ProductsService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterProductsServiceHandlerClient

func RegisterProductsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ProductsServiceClient) error

RegisterProductsServiceHandlerClient registers the http handlers for service ProductsService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ProductsServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ProductsServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ProductsServiceClient" to call the correct interceptors.

func RegisterProductsServiceHandlerFromEndpoint

func RegisterProductsServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterProductsServiceHandlerFromEndpoint is same as RegisterProductsServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterProductsServiceHandlerServer

func RegisterProductsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ProductsServiceServer) error

RegisterProductsServiceHandlerServer registers the http handlers for service ProductsService to "mux". UnaryRPC :call ProductsServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterProductsServiceHandlerFromEndpoint instead.

func RegisterProductsServiceServer

func RegisterProductsServiceServer(s *grpc.Server, srv ProductsServiceServer)

Types

type Product

type Product struct {
	ID           string  `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
	Name         string  `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"`
	Price        float64 `protobuf:"fixed64,3,opt,name=Price,proto3" json:"Price,omitempty"`
	AvailableQty int32   `protobuf:"varint,4,opt,name=AvailableQty,proto3" json:"AvailableQty,omitempty"`
	// contains filtered or unexported fields
}

func (*Product) Descriptor deprecated

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

Deprecated: Use Product.ProtoReflect.Descriptor instead.

func (*Product) GetAvailableQty

func (x *Product) GetAvailableQty() int32

func (*Product) GetID

func (x *Product) GetID() string

func (*Product) GetName

func (x *Product) GetName() string

func (*Product) GetPrice

func (x *Product) GetPrice() float64

func (*Product) ProtoMessage

func (*Product) ProtoMessage()

func (*Product) ProtoReflect

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

func (*Product) Reset

func (x *Product) Reset()

func (*Product) String

func (x *Product) String() string

type Products

type Products struct {
	Products []*Product `protobuf:"bytes,1,rep,name=products,proto3" json:"products,omitempty"`
	// contains filtered or unexported fields
}

func (*Products) Descriptor deprecated

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

Deprecated: Use Products.ProtoReflect.Descriptor instead.

func (*Products) GetProducts

func (x *Products) GetProducts() []*Product

func (*Products) ProtoMessage

func (*Products) ProtoMessage()

func (*Products) ProtoReflect

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

func (*Products) Reset

func (x *Products) Reset()

func (*Products) String

func (x *Products) String() string

type ProductsServiceClient

type ProductsServiceClient interface {
	Find(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Products, error)
}

ProductsServiceClient is the client API for ProductsService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type ProductsServiceServer

type ProductsServiceServer interface {
	Find(context.Context, *empty.Empty) (*Products, error)
}

ProductsServiceServer is the server API for ProductsService service.

type UnimplementedProductsServiceServer

type UnimplementedProductsServiceServer struct {
}

UnimplementedProductsServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedProductsServiceServer) Find

Jump to

Keyboard shortcuts

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