Documentation ¶
Index ¶
- Constants
- type AuthResponse
- type Client
- func (client *Client) Authorize(code, redirectUri string) (*AuthResponse, error)
- func (client *Client) Get(path string) (interface{}, *http.Response, error)
- func (client *Client) GetAuthURL(site, redirectUri string) (string, error)
- func (client *Client) IsExpired() bool
- func (client *Client) RefreshAccessToken() (*AuthResponse, error)
- func (client *Client) SetAuth(auth *AuthResponse)
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 (*Client) Authorize ¶
func (client *Client) Authorize(code, redirectUri string) (*AuthResponse, error)
func (*Client) GetAuthURL ¶
func (*Client) RefreshAccessToken ¶
func (client *Client) RefreshAccessToken() (*AuthResponse, error)
func (*Client) SetAuth ¶
func (client *Client) SetAuth(auth *AuthResponse)
Click to show internal directories.
Click to hide internal directories.