shopee

package
v0.0.0-...-8f9f3ed Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package shopee implements interfacing with Shopee.

Index

Constants

View Source
const Vendor = "SHOPEE"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*models.BaseTenant
	DatabaseTenant *models.BaseDatabaseTenant
	Config         *Config
	Credentials    *oauth2.Credentials
}

Client is a Lazada client.

func (*Client) CollectAllItems

func (c *Client) CollectAllItems() ([]*models.Item, error)

CollectAllItems collects and returns all items registered in this client.

func (*Client) CredentialsExpiry

func (c *Client) CredentialsExpiry() time.Time

func (*Client) CredentialsManager

func (c *Client) CredentialsManager() oauth2.CredentialsManager

func (*Client) Daemon

func (c *Client) Daemon() models.Daemon

func (*Client) GenerateAuthorizationURL

func (c *Client) GenerateAuthorizationURL() string

func (*Client) GenerateCredentials

func (c *Client) GenerateCredentials(greq gjson.Result) (*oauth2.Credentials, error)

func (*Client) LoadItem

func (c *Client) LoadItem(sku string) (*models.Item, error)

LoadItem returns item info for a single SKU. Loading items from the Shopee client requires that this item has already been collected beforehand.

func (*Client) RefreshCredentials

func (c *Client) RefreshCredentials() (*oauth2.Credentials, error)

func (*Client) SaveItem

func (c *Client) SaveItem(item *models.Item) error

SaveItem saves item info for a single SKU. This only implements updating the product stock. Shopee API documentation: https://open.shopee.com/documents/v2/v2.product.update_stock?module=89&type=1

type Config

type Config struct {
	Domain      string `json:"domain"`
	ShopID      int64  `json:"shop_id"`
	PartnerID   int64  `json:"partner_id"`
	PartnerKey  string `json:"partner_key"`
	RedirectURI string `json:"redirect_uri"`
}

Config is a Lazada config.

Jump to

Keyboard shortcuts

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