Documentation ¶
Index ¶
- type Client
- func (c *Client) Do(method, uri string, body io.Reader) ([]byte, error)
- func (c *Client) Get(uri string) ([]byte, error)
- func (c *Client) GetJSON(uri string, obj interface{}) error
- func (c *Client) Post(uri string, data []byte) ([]byte, error)
- func (c *Client) PostJSON(uri string, data []byte, obj interface{}) error
- func (c *Client) SetContentType(ctype string)
- type Error
- type Token
- type TokenHolder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { *TokenHolder // contains filtered or unexported fields }
func (*Client) SetContentType ¶
type Error ¶
type Error struct { Code int `json:"code,string,omitempty"` Message string `json:"message,omitempty"` }
Error ...
type Token ¶
type Token struct { AccessToken string `json:"access_token"` ExpiresIn int64 `json:"expires_in"` Error }
Token ...
type TokenHolder ¶
type TokenHolder struct {
// contains filtered or unexported fields
}
TokenHolder ...
func NewTokenHolder ¶
func NewTokenHolder(uri 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
Click to show internal directories.
Click to hide internal directories.