pub struct Config {
pub api_base_url: String,
pub auth_base_url: String,
pub cache_path: PathBuf,
pub pagination_chunks: u32,
pub token_cached: bool,
pub token_refreshing: bool,
pub token_callback_fn: Arc<Option<TokenCallback>>,
}Expand description
Struct to configure the Spotify client.
Fields§
§api_base_url: StringThe Spotify API prefix, DEFAULT_API_BASE_URL by default.
auth_base_url: StringThe Spotify Authentication prefix, DEFAULT_AUTH_BASE_URL by default.
cache_path: PathBufThe cache file path, in case it’s used. By default it’s
DEFAULT_CACHE_PATH
pagination_chunks: u32The pagination chunk size used when performing automatically paginated
requests, like artist_albums. This
means that a request will be performed every pagination_chunks items.
By default this is DEFAULT_PAGINATION_CHUNKS.
Note that most endpoints set a maximum to the number of items per request, which most times is 50.
token_cached: boolWhether or not to save the authentication token into a JSON file, then reread the token from JSON file when launching the program without following the full auth process again
token_refreshing: boolWhether or not to check if the token has expired when sending a request with credentials, and in that case, automatically refresh it.
token_callback_fn: Arc<Option<TokenCallback>>Whenever client succeeds to request or refresh a token, the callback function will be invoked