lazada

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 lazada implements lazada tenant client.

Index

Constants

View Source
const Vendor = "LAZADA"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*models.BaseTenant
	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.

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.

type Config

type Config struct {
	Domain      string `json:"domain"`
	AppKey      string `json:"app_key"`
	AppSecret   string `json:"app_secret"`
	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