Documentation ¶
Index ¶
- Variables
- func ParseProdURL(urlstr string) (shopid, itemid int64, err error)
- func WithAndroid(c *resty.Client)
- type AccountInfo
- type AddressInfo
- func (a AddressInfo) Address() string
- func (a AddressInfo) City() string
- func (a AddressInfo) Country() string
- func (a AddressInfo) District() string
- func (a AddressInfo) GeoString() string
- func (a AddressInfo) ID() int64
- func (a AddressInfo) Init(json jsoniter.Any, isDeliveryAddr bool) AddressInfo
- func (a AddressInfo) IsDeliveryAddress() bool
- func (a AddressInfo) State() string
- func (a AddressInfo) Town() string
- func (a AddressInfo) Zipcode() string
- type Addresses
- type CheckoutParams
- type CheckoutValidationError
- type CheckoutableItem
- type Client
- func (c Client) CheckoutGetQuick(params CheckoutParams) (CheckoutParams, error)
- func (c Client) FetchAccountInfo() (AccountInfo, error)
- func (c Client) FetchAddresses() (Addresses, error)
- func (c Client) FetchItem(shopid, itemid int64) (Item, error)
- func (c Client) FetchItemFromURL(urlstr string) (Item, error)
- func (c Client) FetchShippingInfo(addr AddressInfo, item Item) ([]LogisticChannelInfo, error)
- func (c Client) PlaceOrder(params CheckoutParams) error
- func (c Client) ValidateCheckout(item CheckoutableItem) error
- type InvalidCookieError
- type Item
- func (i Item) CatIDs() []int64
- func (i Item) CatNames() []string
- func (i Item) HasUpcomingFsale() bool
- func (i Item) Init(json jsoniter.Any) Item
- func (i Item) IsFlashSale() bool
- func (i Item) ItemID() int64
- func (i *Item) Models() []Model
- func (i Item) Name() string
- func (i Item) Price() int64
- func (i Item) PriceMax() int64
- func (i Item) PriceMin() int64
- func (i Item) ShopID() int64
- func (i Item) Stock() int
- func (i Item) TierVariations() []TierVar
- func (i Item) UpcomingFsaleHiddenPrice() string
- func (i Item) UpcomingFsaleStartTime() int64
- type LogisticChannelInfo
- func (c LogisticChannelInfo) ChannelID() int64
- func (c LogisticChannelInfo) HasWarning() bool
- func (c LogisticChannelInfo) Init(json jsoniter.Any) LogisticChannelInfo
- func (c LogisticChannelInfo) MaxPrice() int64
- func (c LogisticChannelInfo) MinPrice() int64
- func (c LogisticChannelInfo) Name() string
- func (c LogisticChannelInfo) PriceBeforeDiscount() int64
- func (c LogisticChannelInfo) Warning() string
- type Model
- type Option
- type PaymentChannel
- type PaymentChannelOption
- type PlaceOrderError
- type TierVar
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUrlNotMatch = errors.New("url doesn't match")
View Source
var ShopeeUrl, _ = url.Parse("https://mall.shopee.co.id")
Functions ¶
func ParseProdURL ¶
parse product url
func WithAndroid ¶
func WithAndroid(c *resty.Client)
Types ¶
type AccountInfo ¶
type AccountInfo struct {
// contains filtered or unexported fields
}
func (AccountInfo) Init ¶
func (a AccountInfo) Init(json jsoniter.Any) AccountInfo
func (AccountInfo) ShopID ¶
func (a AccountInfo) ShopID() int64
func (AccountInfo) UserID ¶
func (a AccountInfo) UserID() int64
func (AccountInfo) Username ¶
func (a AccountInfo) Username() string
type AddressInfo ¶
type AddressInfo struct {
// contains filtered or unexported fields
}
func (AddressInfo) Address ¶
func (a AddressInfo) Address() string
func (AddressInfo) City ¶
func (a AddressInfo) City() string
func (AddressInfo) Country ¶
func (a AddressInfo) Country() string
func (AddressInfo) District ¶
func (a AddressInfo) District() string
func (AddressInfo) GeoString ¶
func (a AddressInfo) GeoString() string
func (AddressInfo) ID ¶
func (a AddressInfo) ID() int64
func (AddressInfo) Init ¶
func (a AddressInfo) Init(json jsoniter.Any, isDeliveryAddr bool) AddressInfo
func (AddressInfo) IsDeliveryAddress ¶
func (a AddressInfo) IsDeliveryAddress() bool
func (AddressInfo) State ¶
func (a AddressInfo) State() string
func (AddressInfo) Town ¶
func (a AddressInfo) Town() string
func (AddressInfo) Zipcode ¶
func (a AddressInfo) Zipcode() string
type Addresses ¶
type Addresses []AddressInfo
func (Addresses) DeliveryAddress ¶
func (a Addresses) DeliveryAddress() (int, AddressInfo)
returns index -1 if not found
type CheckoutParams ¶
type CheckoutParams struct { Addr AddressInfo Item CheckoutableItem Payment PaymentChannel // PaymentChannelOption.OptionInfo PaymentOption string Logistic LogisticChannelInfo // contains filtered or unexported fields }
all exported fields are required
func (CheckoutParams) FSV ¶
func (c CheckoutParams) FSV() (id uint64, code string)
func (CheckoutParams) Timestamp ¶
func (c CheckoutParams) Timestamp() int64
func (CheckoutParams) WithFSV ¶
func (c CheckoutParams) WithFSV(id uint64, code string) CheckoutParams
func (CheckoutParams) WithTimestamp ¶
func (c CheckoutParams) WithTimestamp(ts int64) CheckoutParams
type CheckoutValidationError ¶
type CheckoutValidationError struct {
// contains filtered or unexported fields
}
func (CheckoutValidationError) Code ¶
func (c CheckoutValidationError) Code() int
func (CheckoutValidationError) Error ¶
func (c CheckoutValidationError) Error() string
func (CheckoutValidationError) Msg ¶
func (c CheckoutValidationError) Msg() string
func (CheckoutValidationError) ValidationCode ¶
func (c CheckoutValidationError) ValidationCode() int
type CheckoutableItem ¶
type CheckoutableItem struct { Item // contains filtered or unexported fields }
func ChooseModel ¶
func ChooseModel(item Item, modelId int64) CheckoutableItem
func ChooseModelByTierVar ¶
func ChooseModelByTierVar(item Item, indexes []int) CheckoutableItem
indexes is tier variations index. indexes must be the same length as len(item.TierVariations())
func (CheckoutableItem) ChosenModel ¶
func (c CheckoutableItem) ChosenModel() Model
type Client ¶
type Client struct {
Client *resty.Client
}
func (Client) CheckoutGetQuick ¶
func (c Client) CheckoutGetQuick(params CheckoutParams) (CheckoutParams, error)
func (Client) FetchAccountInfo ¶
func (c Client) FetchAccountInfo() (AccountInfo, error)
func (Client) FetchAddresses ¶
func (Client) FetchShippingInfo ¶
func (c Client) FetchShippingInfo(addr AddressInfo, item Item) ([]LogisticChannelInfo, error)
func (Client) PlaceOrder ¶
func (c Client) PlaceOrder(params CheckoutParams) error
func (Client) ValidateCheckout ¶
func (c Client) ValidateCheckout(item CheckoutableItem) error
type InvalidCookieError ¶
type InvalidCookieError string
func (InvalidCookieError) Error ¶
func (i InvalidCookieError) Error() string
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
shopee product item
func (Item) HasUpcomingFsale ¶
func (Item) IsFlashSale ¶
func (Item) TierVariations ¶
func (Item) UpcomingFsaleStartTime ¶
type LogisticChannelInfo ¶
type LogisticChannelInfo struct {
// contains filtered or unexported fields
}
func (LogisticChannelInfo) ChannelID ¶
func (c LogisticChannelInfo) ChannelID() int64
func (LogisticChannelInfo) HasWarning ¶
func (c LogisticChannelInfo) HasWarning() bool
func (LogisticChannelInfo) Init ¶
func (c LogisticChannelInfo) Init(json jsoniter.Any) LogisticChannelInfo
func (LogisticChannelInfo) MaxPrice ¶
func (c LogisticChannelInfo) MaxPrice() int64
func (LogisticChannelInfo) MinPrice ¶
func (c LogisticChannelInfo) MinPrice() int64
func (LogisticChannelInfo) Name ¶
func (c LogisticChannelInfo) Name() string
func (LogisticChannelInfo) PriceBeforeDiscount ¶
func (c LogisticChannelInfo) PriceBeforeDiscount() int64
func (LogisticChannelInfo) Warning ¶
func (c LogisticChannelInfo) Warning() string
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func (Model) HasUpcomingFsale ¶
type PaymentChannel ¶
type PaymentChannel int
const ( ShopeePay PaymentChannel = iota COD TransferBank Alfamart Indomaret )
func (PaymentChannel) BuyerTxnFee ¶
func (p PaymentChannel) BuyerTxnFee(option string) int64
func (PaymentChannel) Data ¶
func (p PaymentChannel) Data(option string) map[string]interface{}
func (PaymentChannel) Name ¶
func (p PaymentChannel) Name() string
func (PaymentChannel) Options ¶
func (p PaymentChannel) Options() []PaymentChannelOption
func (PaymentChannel) String ¶
func (p PaymentChannel) String() string
type PaymentChannelOption ¶
type PaymentChannelOption struct{ Name, OptionInfo string }
type PlaceOrderError ¶
type PlaceOrderError struct {
// contains filtered or unexported fields
}
func (PlaceOrderError) Error ¶
func (p PlaceOrderError) Error() string
func (PlaceOrderError) Msg ¶
func (p PlaceOrderError) Msg() string
func (PlaceOrderError) Type ¶
func (p PlaceOrderError) Type() string
Click to show internal directories.
Click to hide internal directories.