v0.1.1 Latest Latest

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

Go to latest
Published: Feb 5, 2020 License: MIT Imports: 12 Imported by: 2




This section is empty.


This section is empty.


func DoHTTP

func DoHTTP(method, uri string, auths string, body io.Reader) ([]byte, error)


type Client

type Client struct {
	// contains filtered or unexported fields

func NewClient

func NewClient(urlToken string) *Client

func (*Client) Do

func (c *Client) Do(method, uri string, body io.Reader) ([]byte, error)

func (*Client) Get

func (c *Client) Get(uri string) ([]byte, error)

func (*Client) GetJSON

func (c *Client) GetJSON(uri string, obj interface{}) error

func (*Client) Post

func (c *Client) Post(uri string, data []byte) ([]byte, error)

func (*Client) PostJSON

func (c *Client) PostJSON(uri string, data []byte, obj interface{}) error

func (*Client) SetAuth

func (c *Client) SetAuth(auths string)

func (*Client) SetContentType

func (c *Client) SetContentType(ctype string)

type Error

type Error struct {
	ErrCode int    `json:"errcode,omitempty"`
	ErrMsg  string `json:"errmsg,omitempty"`

func (*Error) Error

func (e *Error) Error() string

type Token

type Token struct {
	AccessToken  string `json:"access_token"`
	TokenType    string `json:"token_type,omitempty"`
	ExpiresIn    int64  `json:"expires_in"`
	RefreshToken string `json:"refresh_token,omitempty"`

type TokenHolder

type TokenHolder struct {
	// contains filtered or unexported fields

func NewTokenHolder

func NewTokenHolder(baseUrl string) *TokenHolder

func (*TokenHolder) Expired

func (th *TokenHolder) Expired() bool

func (*TokenHolder) GetAuthToken

func (th *TokenHolder) GetAuthToken() (token string, err error)

func (*TokenHolder) SetAuth

func (th *TokenHolder) SetAuth(auths string)

func (*TokenHolder) SetCorp

func (th *TokenHolder) SetCorp(id, secret string)

func (*TokenHolder) Valid

func (th *TokenHolder) Valid() bool

Jump to

Keyboard shortcuts

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