cost

package
v0.0.0-...-6c3add7 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cost_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "Cost",
	HandlerType: (*CostServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetUnitCost",
			Handler:    _Cost_GetUnitCost_Handler,
		},
		{
			MethodName: "UpdateUnitCost",
			Handler:    _Cost_UpdateUnitCost_Handler,
		},
		{
			MethodName: "AddUnitCost",
			Handler:    _Cost_AddUnitCost_Handler,
		},
		{
			MethodName: "TotalBasket",
			Handler:    _Cost_TotalBasket_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "cost.proto",
}

Cost_ServiceDesc is the grpc.ServiceDesc for Cost service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterCostServer

func RegisterCostServer(s grpc.ServiceRegistrar, srv CostServer)

Types

type Basket

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

func (*Basket) Descriptor deprecated

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

Deprecated: Use Basket.ProtoReflect.Descriptor instead.

func (*Basket) GetItems

func (x *Basket) GetItems() []*Basket_Item

func (*Basket) ProtoMessage

func (*Basket) ProtoMessage()

func (*Basket) ProtoReflect

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

func (*Basket) Reset

func (x *Basket) Reset()

func (*Basket) String

func (x *Basket) String() string

type Basket_Item

type Basket_Item struct {
	ID    string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
	Count int64  `protobuf:"varint,2,opt,name=Count,proto3" json:"Count,omitempty"`
	// contains filtered or unexported fields
}

func (*Basket_Item) Descriptor deprecated

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

Deprecated: Use Basket_Item.ProtoReflect.Descriptor instead.

func (*Basket_Item) GetCount

func (x *Basket_Item) GetCount() int64

func (*Basket_Item) GetID

func (x *Basket_Item) GetID() string

func (*Basket_Item) ProtoMessage

func (*Basket_Item) ProtoMessage()

func (*Basket_Item) ProtoReflect

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

func (*Basket_Item) Reset

func (x *Basket_Item) Reset()

func (*Basket_Item) String

func (x *Basket_Item) String() string

type CostClient

type CostClient interface {
	GetUnitCost(ctx context.Context, in *CostRequest, opts ...grpc.CallOption) (*CostResponse, error)
	UpdateUnitCost(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error)
	AddUnitCost(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error)
	TotalBasket(ctx context.Context, in *Basket, opts ...grpc.CallOption) (*CostResponse, error)
}

CostClient is the client API for Cost service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewCostClient

func NewCostClient(cc grpc.ClientConnInterface) CostClient

type CostRequest

type CostRequest struct {
	ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
	// contains filtered or unexported fields
}

func (*CostRequest) Descriptor deprecated

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

Deprecated: Use CostRequest.ProtoReflect.Descriptor instead.

func (*CostRequest) GetID

func (x *CostRequest) GetID() string

func (*CostRequest) ProtoMessage

func (*CostRequest) ProtoMessage()

func (*CostRequest) ProtoReflect

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

func (*CostRequest) Reset

func (x *CostRequest) Reset()

func (*CostRequest) String

func (x *CostRequest) String() string

type CostResponse

type CostResponse struct {
	Price float64 `protobuf:"fixed64,1,opt,name=Price,proto3" json:"Price,omitempty"`
	// contains filtered or unexported fields
}

func (*CostResponse) Descriptor deprecated

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

Deprecated: Use CostResponse.ProtoReflect.Descriptor instead.

func (*CostResponse) GetPrice

func (x *CostResponse) GetPrice() float64

func (*CostResponse) ProtoMessage

func (*CostResponse) ProtoMessage()

func (*CostResponse) ProtoReflect

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

func (*CostResponse) Reset

func (x *CostResponse) Reset()

func (*CostResponse) String

func (x *CostResponse) String() string

type CostServer

type CostServer interface {
	GetUnitCost(context.Context, *CostRequest) (*CostResponse, error)
	UpdateUnitCost(context.Context, *UpdateRequest) (*UpdateResponse, error)
	AddUnitCost(context.Context, *UpdateRequest) (*UpdateResponse, error)
	TotalBasket(context.Context, *Basket) (*CostResponse, error)
}

CostServer is the server API for Cost service. All implementations should embed UnimplementedCostServer for forward compatibility

type UnimplementedCostServer

type UnimplementedCostServer struct {
}

UnimplementedCostServer should be embedded to have forward compatible implementations.

func (UnimplementedCostServer) AddUnitCost

func (UnimplementedCostServer) GetUnitCost

func (UnimplementedCostServer) TotalBasket

func (UnimplementedCostServer) UpdateUnitCost

type UnsafeCostServer

type UnsafeCostServer interface {
	// contains filtered or unexported methods
}

UnsafeCostServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CostServer will result in compilation errors.

type UpdateRequest

type UpdateRequest struct {
	ID    string  `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
	Price float64 `protobuf:"fixed64,2,opt,name=Price,proto3" json:"Price,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateRequest) Descriptor deprecated

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

Deprecated: Use UpdateRequest.ProtoReflect.Descriptor instead.

func (*UpdateRequest) GetID

func (x *UpdateRequest) GetID() string

func (*UpdateRequest) GetPrice

func (x *UpdateRequest) GetPrice() float64

func (*UpdateRequest) ProtoMessage

func (*UpdateRequest) ProtoMessage()

func (*UpdateRequest) ProtoReflect

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

func (*UpdateRequest) Reset

func (x *UpdateRequest) Reset()

func (*UpdateRequest) String

func (x *UpdateRequest) String() string

type UpdateResponse

type UpdateResponse struct {
	Success bool `protobuf:"varint,1,opt,name=Success,proto3" json:"Success,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateResponse) Descriptor deprecated

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

Deprecated: Use UpdateResponse.ProtoReflect.Descriptor instead.

func (*UpdateResponse) GetSuccess

func (x *UpdateResponse) GetSuccess() bool

func (*UpdateResponse) ProtoMessage

func (*UpdateResponse) ProtoMessage()

func (*UpdateResponse) ProtoReflect

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

func (*UpdateResponse) Reset

func (x *UpdateResponse) Reset()

func (*UpdateResponse) String

func (x *UpdateResponse) String() string

Jump to

Keyboard shortcuts

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