cart

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

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

Go to latest
Published: Oct 26, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_cart_cart_proto protoreflect.FileDescriptor

Functions

func NewCartEndpoints

func NewCartEndpoints() []*api.Endpoint

func RegisterCartHandler

func RegisterCartHandler(s server.Server, hdlr CartHandler, opts ...server.HandlerOption) error

Types

type CartAll

type CartAll struct {
	CartInfo []*CartInfo `protobuf:"bytes,1,rep,name=cart_info,json=cartInfo,proto3" json:"cart_info,omitempty"`
	// contains filtered or unexported fields
}

func (*CartAll) Descriptor deprecated

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

Deprecated: Use CartAll.ProtoReflect.Descriptor instead.

func (*CartAll) GetCartInfo

func (x *CartAll) GetCartInfo() []*CartInfo

func (*CartAll) ProtoMessage

func (*CartAll) ProtoMessage()

func (*CartAll) ProtoReflect

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

func (*CartAll) Reset

func (x *CartAll) Reset()

func (*CartAll) String

func (x *CartAll) String() string

type CartFindAll

type CartFindAll struct {
	UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// contains filtered or unexported fields
}

func (*CartFindAll) Descriptor deprecated

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

Deprecated: Use CartFindAll.ProtoReflect.Descriptor instead.

func (*CartFindAll) GetUserId

func (x *CartFindAll) GetUserId() int64

func (*CartFindAll) ProtoMessage

func (*CartFindAll) ProtoMessage()

func (*CartFindAll) ProtoReflect

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

func (*CartFindAll) Reset

func (x *CartFindAll) Reset()

func (*CartFindAll) String

func (x *CartFindAll) String() string

type CartHandler

type CartHandler interface {
	AddCart(context.Context, *CartInfo, *ResponseAdd) error
	CleanCart(context.Context, *Clean, *Response) error
	Incr(context.Context, *Item, *Response) error
	Decr(context.Context, *Item, *Response) error
	DeleteItemByID(context.Context, *CartID, *Response) error
	GetAll(context.Context, *CartFindAll, *CartAll) error
}

type CartID

type CartID struct {
	Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*CartID) Descriptor deprecated

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

Deprecated: Use CartID.ProtoReflect.Descriptor instead.

func (*CartID) GetId

func (x *CartID) GetId() int64

func (*CartID) ProtoMessage

func (*CartID) ProtoMessage()

func (*CartID) ProtoReflect

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

func (*CartID) Reset

func (x *CartID) Reset()

func (*CartID) String

func (x *CartID) String() string

type CartInfo

type CartInfo struct {
	Id        int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	UserId    int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	ProductId int64 `protobuf:"varint,3,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"`
	Size      int64 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"`
	Num       int64 `protobuf:"varint,5,opt,name=num,proto3" json:"num,omitempty"`
	// contains filtered or unexported fields
}

func (*CartInfo) Descriptor deprecated

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

Deprecated: Use CartInfo.ProtoReflect.Descriptor instead.

func (*CartInfo) GetId

func (x *CartInfo) GetId() int64

func (*CartInfo) GetNum

func (x *CartInfo) GetNum() int64

func (*CartInfo) GetProductId

func (x *CartInfo) GetProductId() int64

func (*CartInfo) GetSize

func (x *CartInfo) GetSize() int64

func (*CartInfo) GetUserId

func (x *CartInfo) GetUserId() int64

func (*CartInfo) ProtoMessage

func (*CartInfo) ProtoMessage()

func (*CartInfo) ProtoReflect

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

func (*CartInfo) Reset

func (x *CartInfo) Reset()

func (*CartInfo) String

func (x *CartInfo) String() string

type CartService

type CartService interface {
	AddCart(ctx context.Context, in *CartInfo, opts ...client.CallOption) (*ResponseAdd, error)
	CleanCart(ctx context.Context, in *Clean, opts ...client.CallOption) (*Response, error)
	Incr(ctx context.Context, in *Item, opts ...client.CallOption) (*Response, error)
	Decr(ctx context.Context, in *Item, opts ...client.CallOption) (*Response, error)
	DeleteItemByID(ctx context.Context, in *CartID, opts ...client.CallOption) (*Response, error)
	GetAll(ctx context.Context, in *CartFindAll, opts ...client.CallOption) (*CartAll, error)
}

func NewCartService

func NewCartService(name string, c client.Client) CartService

type Clean

type Clean struct {
	UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// contains filtered or unexported fields
}

func (*Clean) Descriptor deprecated

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

Deprecated: Use Clean.ProtoReflect.Descriptor instead.

func (*Clean) GetUserId

func (x *Clean) GetUserId() int64

func (*Clean) ProtoMessage

func (*Clean) ProtoMessage()

func (*Clean) ProtoReflect

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

func (*Clean) Reset

func (x *Clean) Reset()

func (*Clean) String

func (x *Clean) String() string

type Item

type Item struct {
	Id        int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	ChangeNum int64 `protobuf:"varint,2,opt,name=change_num,json=changeNum,proto3" json:"change_num,omitempty"`
	// contains filtered or unexported fields
}

func (*Item) Descriptor deprecated

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

Deprecated: Use Item.ProtoReflect.Descriptor instead.

func (*Item) GetChangeNum

func (x *Item) GetChangeNum() int64

func (*Item) GetId

func (x *Item) GetId() int64

func (*Item) ProtoMessage

func (*Item) ProtoMessage()

func (*Item) ProtoReflect

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

func (*Item) Reset

func (x *Item) Reset()

func (*Item) String

func (x *Item) String() string

type Response

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

func (*Response) Descriptor deprecated

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

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetMsg

func (x *Response) GetMsg() string

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

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

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

type ResponseAdd

type ResponseAdd struct {
	CartId int64  `protobuf:"varint,1,opt,name=cart_id,json=cartId,proto3" json:"cart_id,omitempty"`
	Msg    string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
	// contains filtered or unexported fields
}

func (*ResponseAdd) Descriptor deprecated

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

Deprecated: Use ResponseAdd.ProtoReflect.Descriptor instead.

func (*ResponseAdd) GetCartId

func (x *ResponseAdd) GetCartId() int64

func (*ResponseAdd) GetMsg

func (x *ResponseAdd) GetMsg() string

func (*ResponseAdd) ProtoMessage

func (*ResponseAdd) ProtoMessage()

func (*ResponseAdd) ProtoReflect

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

func (*ResponseAdd) Reset

func (x *ResponseAdd) Reset()

func (*ResponseAdd) String

func (x *ResponseAdd) String() string

Jump to

Keyboard shortcuts

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