Documentation
¶
Overview ¶
Package stock is a generated protocol buffer package.
It is generated from these files:
github.com/chazsmi/stock-service/proto/stock.proto
It has these top-level messages:
StockRequest StockReadResponse StockWriteResponse
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterStockHandler ¶
func RegisterStockHandler(s server.Server, hdlr StockHandler, opts ...server.HandlerOption)
Types ¶
type Stock ¶
type Stock struct {
StockHandler
}
func (*Stock) Check ¶
func (h *Stock) Check(ctx context.Context, in *StockRequest, out *StockReadResponse) error
func (*Stock) Update ¶
func (h *Stock) Update(ctx context.Context, in *StockRequest, out *StockWriteResponse) error
type StockClient ¶
type StockClient interface { Check(ctx context.Context, in *StockRequest, opts ...client.CallOption) (*StockReadResponse, error) Update(ctx context.Context, in *StockRequest, opts ...client.CallOption) (*StockWriteResponse, error) }
func NewStockClient ¶
func NewStockClient(serviceName string, c client.Client) StockClient
type StockHandler ¶
type StockHandler interface { Check(context.Context, *StockRequest, *StockReadResponse) error Update(context.Context, *StockRequest, *StockWriteResponse) error }
type StockReadResponse ¶
type StockReadResponse struct { Sku string `protobuf:"bytes,1,opt,name=sku" json:"sku,omitempty"` Amount int32 `protobuf:"varint,2,opt,name=amount" json:"amount,omitempty"` }
func (*StockReadResponse) Descriptor ¶
func (*StockReadResponse) Descriptor() ([]byte, []int)
func (*StockReadResponse) ProtoMessage ¶
func (*StockReadResponse) ProtoMessage()
func (*StockReadResponse) Reset ¶
func (m *StockReadResponse) Reset()
func (*StockReadResponse) String ¶
func (m *StockReadResponse) String() string
type StockRequest ¶
type StockRequest struct { Sku string `protobuf:"bytes,1,opt,name=sku" json:"sku,omitempty"` Amount int32 `protobuf:"varint,2,opt,name=amount" json:"amount,omitempty"` }
func (*StockRequest) Descriptor ¶
func (*StockRequest) Descriptor() ([]byte, []int)
func (*StockRequest) ProtoMessage ¶
func (*StockRequest) ProtoMessage()
func (*StockRequest) Reset ¶
func (m *StockRequest) Reset()
func (*StockRequest) String ¶
func (m *StockRequest) String() string
type StockWriteResponse ¶
type StockWriteResponse struct {
Success bool `protobuf:"varint,1,opt,name=success" json:"success,omitempty"`
}
func (*StockWriteResponse) Descriptor ¶
func (*StockWriteResponse) Descriptor() ([]byte, []int)
func (*StockWriteResponse) ProtoMessage ¶
func (*StockWriteResponse) ProtoMessage()
func (*StockWriteResponse) Reset ¶
func (m *StockWriteResponse) Reset()
func (*StockWriteResponse) String ¶
func (m *StockWriteResponse) String() string
Click to show internal directories.
Click to hide internal directories.