Documentation ¶
Overview ¶
Package yauth provides functionality for OAuth authorization for Yahoo. This package is best suited for CLIs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type YAuth ¶
type YAuth struct { ClientID string `json:"client_id"` ClientSecret string `json:"client_secret"` Token *oauth2.Token `json:"token"` }
YAuth holds client credentials along with an access token from Yahoo.
func CreateYAuthFromJSON ¶
CreateYAuthFromJSON builds a YAuth object from the JSON file located at the provided path. If there is no token in the JSON, one will be retrieved and the file will be updated.
func CreateYAuthFromRawCredentials ¶
CreateYAuthFromRawCredentials builds a YAuth object using the provided client id and client secret. This function will always request a token from Yahoo.
func (*YAuth) Client ¶
Client returns a http.Client to be used for sending requests to Yahoo's API endpoints that require OAuth.
func (*YAuth) WriteToFile ¶
WriteToFile writes the YAuth object to the given file in JSON format.