go_micro_service_cart

package
v0.0.0-...-04224c6 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_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 AllRequest

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

func (*AllRequest) Descriptor deprecated

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

Deprecated: Use AllRequest.ProtoReflect.Descriptor instead.

func (*AllRequest) GetUserId

func (x *AllRequest) GetUserId() uint64

func (*AllRequest) ProtoMessage

func (*AllRequest) ProtoMessage()

func (*AllRequest) ProtoReflect

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

func (*AllRequest) Reset

func (x *AllRequest) Reset()

func (*AllRequest) String

func (x *AllRequest) String() string

type CartAll

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

func (*CartAll) Descriptor deprecated

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

Deprecated: Use CartAll.ProtoReflect.Descriptor instead.

func (*CartAll) GetAllCartInfos

func (x *CartAll) GetAllCartInfos() []*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 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, *AllRequest, *CartAll) error
}

type CartId

type CartId struct {
	Id uint64 `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() uint64

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        uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	UserId    uint64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	ProductId uint64 `protobuf:"varint,3,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"`
	SizeId    uint64 `protobuf:"varint,4,opt,name=size_id,json=sizeId,proto3" json:"size_id,omitempty"`
	Num       uint64 `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() uint64

func (*CartInfo) GetNum

func (x *CartInfo) GetNum() uint64

func (*CartInfo) GetProductId

func (x *CartInfo) GetProductId() uint64

func (*CartInfo) GetSizeId

func (x *CartInfo) GetSizeId() uint64

func (*CartInfo) GetUserId

func (x *CartInfo) GetUserId() uint64

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 *AllRequest, opts ...client.CallOption) (*CartAll, error)
}

func NewCartService

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

type Clean

type Clean struct {
	UserId uint64 `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() uint64

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        uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	ChangeNum uint64 `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() uint64

func (*Item) GetId

func (x *Item) GetId() uint64

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 uint64 `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() uint64

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