GenServer for managing OAuth tokens.
Automatically obtains, caches, and refreshes OAuth tokens. Refreshes tokens 5 minutes before expiry.
Summary
Functions
Returns a specification to start this module under a supervisor.
Forces a token refresh.
Starts the token manager.
Returns the current OAuth token.
Types
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec refresh() :: :ok | {:error, AirtelMoney.Error.t()}
Forces a token refresh.
@spec start_link(keyword()) :: GenServer.on_start()
Starts the token manager.
@spec token() :: {:ok, String.t()} | {:error, AirtelMoney.Error.t()}
Returns the current OAuth token.