Documentation ¶
Overview ¶
Package coupon is a generated protocol buffer package.
It is generated from these files:
coupon.proto
It has these top-level messages:
CouponRequest CouponResponse
Index ¶
- func AcceptCouponServiceClient(lis net.Listener, x CouponService)
- func CheckSign(sign_str, data, salt string) bool
- func ListenAndServeCouponService(network, addr string, x CouponService) error
- func NewCouponServiceServer(x CouponService) *rpc.Server
- func RegisterCouponService(srv *rpc.Server, x CouponService) error
- func Sign(data string, salt string) string
- type AvailableReqArg
- type AvailableRes
- type CouponRequest
- type CouponResponse
- type CouponService
- type CouponServiceClient
- type UseReqArg
- type UseRes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AcceptCouponServiceClient ¶
func AcceptCouponServiceClient(lis net.Listener, x CouponService)
AcceptCouponServiceClient accepts connections on the listener and serves requests for each incoming connection. Accept blocks; the caller typically invokes it in a go statement.
func ListenAndServeCouponService ¶
func ListenAndServeCouponService(network, addr string, x CouponService) error
ListenAndServeCouponService listen announces on the local network address laddr and serves the given CouponService implementation.
func NewCouponServiceServer ¶
func NewCouponServiceServer(x CouponService) *rpc.Server
NewCouponServiceServer returns a new CouponService Server.
func RegisterCouponService ¶
func RegisterCouponService(srv *rpc.Server, x CouponService) error
RegisterCouponService publish the given CouponService implementation on the server.
Types ¶
type AvailableReqArg ¶
type AvailableRes ¶
type AvailableRes struct { Available bool `json:"available"` Money string `json:"money"` Name string `json:"name"` }
func IsAvailable ¶
func IsAvailable(dbname, user_id, product_id, user_coupon_id string, url ...string) (*AvailableRes, error)
*
- 优惠券是否可用
- @param data {"user_id":"","product_id":"","coupon_id":""}
- @param return is_available,name,money,error
type CouponRequest ¶
type CouponRequest struct { Data *string `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"` Time *string `protobuf:"bytes,2,opt,name=time" json:"time,omitempty"` Sign *string `protobuf:"bytes,3,opt,name=sign" json:"sign,omitempty"` XXX_unrecognized []byte `json:"-"` }
是否可用请求结构
func (*CouponRequest) GetData ¶
func (m *CouponRequest) GetData() string
func (*CouponRequest) GetSign ¶
func (m *CouponRequest) GetSign() string
func (*CouponRequest) GetTime ¶
func (m *CouponRequest) GetTime() string
func (*CouponRequest) ProtoMessage ¶
func (*CouponRequest) ProtoMessage()
func (*CouponRequest) Reset ¶
func (m *CouponRequest) Reset()
func (*CouponRequest) String ¶
func (m *CouponRequest) String() string
type CouponResponse ¶
type CouponResponse struct { Data *string `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"` Time *string `protobuf:"bytes,2,opt,name=time" json:"time,omitempty"` Sign *string `protobuf:"bytes,3,opt,name=sign" json:"sign,omitempty"` XXX_unrecognized []byte `json:"-"` }
是否可用响应结构
func (*CouponResponse) GetData ¶
func (m *CouponResponse) GetData() string
func (*CouponResponse) GetSign ¶
func (m *CouponResponse) GetSign() string
func (*CouponResponse) GetTime ¶
func (m *CouponResponse) GetTime() string
func (*CouponResponse) ProtoMessage ¶
func (*CouponResponse) ProtoMessage()
func (*CouponResponse) Reset ¶
func (m *CouponResponse) Reset()
func (*CouponResponse) String ¶
func (m *CouponResponse) String() string
type CouponService ¶
type CouponService interface { IsAvailable(in *CouponRequest, out *CouponResponse) error Use(in *CouponRequest, out *CouponResponse) error }
type CouponServiceClient ¶
func DialCouponService ¶
func DialCouponService(network, addr string) (*CouponServiceClient, *rpc.Client, error)
DialCouponService connects to an CouponService at the specified network address.
func DialCouponServiceTimeout ¶
func DialCouponServiceTimeout(network, addr string, timeout time.Duration) (*CouponServiceClient, *rpc.Client, error)
DialCouponServiceTimeout connects to an CouponService at the specified network address.
func NewCouponServiceClient ¶
func NewCouponServiceClient(conn io.ReadWriteCloser) (*CouponServiceClient, *rpc.Client)
NewCouponServiceClient returns a CouponService rpc.Client and stub to handle requests to the set of CouponService at the other end of the connection.
func (*CouponServiceClient) IsAvailable ¶
func (c *CouponServiceClient) IsAvailable(in *CouponRequest, out *CouponResponse) error
func (*CouponServiceClient) Use ¶
func (c *CouponServiceClient) Use(in *CouponRequest, out *CouponResponse) error