# Functions
Config does the initial creation of the token
It may run an internal webserver to receive the results.
ConfigErrorCheck does the same as Config, but allows the backend to pass a error handling function This function gets called with the request made to rclone as a parameter if no code was found.
ConfigNoOffline does the same as Config but does not pass the "access_type=offline" parameter.
Context returns a context with our HTTP Client baked in for oauth2.
GetToken returns the token saved in the config file under section name.
NewClient gets a token from the config file and configures a Client with it.
NewClientWithBaseClient gets a token from the config file and configures a Client with it.
NewRenew creates a new Renew struct and starts a background process which renews the token whenever it expires.
PutToken stores the token in the config file
This saves the config file if it changes.
# Constants
AuthResponse is a template to handle the redirect URL for oauth requests.
RedirectLocalhostURL is redirect to local webserver when active with localhost.
RedirectPublicURL is redirect to local webserver when active with public name.
RedirectURL is redirect to local webserver when active.
TitleBarRedirectURL is the OAuth2 redirect URL to use when the authorization code should be returned in the title bar of the browser, with the page text prompting the user to copy the code and paste it in the application.
# Structs
AuthError gets returned by the backend's errorHandler function.
AuthResponseData can fill the AuthResponse template.
Renew allows tokens to be renewed on expiry if uploads are in progress.
TokenSource stores updated tokens in the config file.