SetAccessToken

This commit is contained in:
Alexander Plutov 2015-11-19 12:12:42 +07:00
parent 01a9cc8bc9
commit 5fa983e86a

View File

@ -23,6 +23,15 @@ func NewClient(clientID string, secret string, APIBase string) (*Client, error)
}, nil
}
// SetAccessToken sets saved token to current client
func (c *Client) SetAccessToken(token string) error {
c.Token = &TokenResponse{
Token: token,
}
return nil
}
// Send makes a request to the API, the response body will be
// unmarshaled into v, or if v is an io.Writer, the response will
// be written to it without decoding