View Source TwitchAPI.AuthCallbacks behaviour (hello_twitch_api v0.5.1)

Behaviour defined for TwitchAPI.AuthStore callback options.

Summary

Types

The name argument is the name used to register the auth store in the Registry, and is useful for distinguishing between different auth stores if you have many.

Callbacks

This function is called after the TwitchAPI.AuthStore.init/2 function is called, and before the token is validated (and attempted to refresh if not valid).

This function is called whenever a TwitchAPI.Auth.t/0 is added to the store and every time a token is refreshed.

This function is called whenever the TwitchAPI.AuthStore.terminate/2 function is called. It is useful for any clean-up needed.

Types

@type name() :: term()

The name argument is the name used to register the auth store in the Registry, and is useful for distinguishing between different auth stores if you have many.

Callbacks

@callback load(name(), TwitchAPI.Auth.t()) :: TwitchAPI.Auth.t()

This function is called after the TwitchAPI.AuthStore.init/2 function is called, and before the token is validated (and attempted to refresh if not valid).

@callback put(name(), TwitchAPI.Auth.t()) :: TwitchAPI.Auth.t()

This function is called whenever a TwitchAPI.Auth.t/0 is added to the store and every time a token is refreshed.

@callback terminate(name(), TwitchAPI.Auth.t()) :: TwitchAPI.Auth.t()

This function is called whenever the TwitchAPI.AuthStore.terminate/2 function is called. It is useful for any clean-up needed.