mercadolibre

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2019 License: MIT Imports: 6 Imported by: 0

README

Go MercadoLibre

Unofficial GO Client for MercadoLibre Platform.

GoDoc

How to install

go get github.com/ielijose/go-mercadolibre

License

The MIT License (MIT) Copyright (c) 2013

Documentation

Index

Constants

View Source
const (
	AuthURLMLA = "https://auth.mercadolibre.com.ar" // Argentina
	AuthURLMLB = "https://auth.mercadolivre.com.br" // Brasil
	AuthURLMCO = "https://auth.mercadolibre.com.co" // Colombia
	AuthURLMCR = "https://auth.mercadolibre.com.cr" // Costa Rica
	AuthURLMEC = "https://auth.mercadolibre.com.ec" // Ecuador
	AuthURLMLC = "https://auth.mercadolibre.cl"     // Chile
	AuthURLMLM = "https://auth.mercadolibre.com.mx" // Mexico
	AuthURLMLU = "https://auth.mercadolibre.com.uy" // Uruguay
	AuthURLMLV = "https://auth.mercadolibre.com.ve" // Venezuela
	AuthURLMPA = "https://auth.mercadolibre.com.pa" // Panama
	AuthURLMPE = "https://auth.mercadolibre.com.pe" // Peru
	AuthURLMPT = "https://auth.mercadolivre.pt"     // Portugal
	AuthURLMRD = "https://auth.mercadolibre.com.do" // Dominicana

)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthResponse

type AuthResponse struct {
	AccessToken  string `json:"access_token"`
	TokenType    string `json:"token_type"`
	ExpiresIn    int    `json:"expires_in"`
	Scope        string `json:"scope"`
	UserID       int    `json:"user_id"`
	RefreshToken string `json:"refresh_token"`
	ReceivedAt   int64  `json:"received_at"`
}

func (AuthResponse) IsExpired

func (auth AuthResponse) IsExpired() bool

type Client

type Client struct {
	Auth AuthResponse
	// contains filtered or unexported fields
}

func MercadoLibreClient

func MercadoLibreClient(clientId string, clientSecret string) *Client

func (*Client) Authorize

func (client *Client) Authorize(code, redirectUri string) (*AuthResponse, error)

func (*Client) Get

func (client *Client) Get(path string) (interface{}, *http.Response, error)

func (*Client) GetAuthURL

func (client *Client) GetAuthURL(site, redirectUri string) (string, error)

func (*Client) IsExpired

func (client *Client) IsExpired() bool

func (*Client) RefreshAccessToken

func (client *Client) RefreshAccessToken() (*AuthResponse, error)

func (*Client) SetAuth

func (client *Client) SetAuth(auth *AuthResponse)

Jump to

Keyboard shortcuts

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