astarte_device v0.11.3 Astarte.Device.CredentialStorage behaviour
User defined credential storage.
Astarte.Device.CredentialStorage
defines a behaviour that can be given to an Astarte.Device
. This allows the user to specify how device credentials are stored.
Link to this section Summary
Types
Supported credential keys. You can pattern match on these if you want to store them each in a different way.
Callbacks
Fetch the specified credential from the credential storage.
Save the specified credential to the credential storage.
Link to this section Types
Supported credential keys. You can pattern match on these if you want to store them each in a different way.
Link to this section Callbacks
Link to this callback
fetch(key, state)
fetch(key :: credential(), state :: term()) :: {:ok, credential :: String.t()} | :error
Fetch the specified credential from the credential storage.
Link to this callback
save(key, value, state)
save(key :: credential(), value :: String.t(), state :: term()) :: {:ok, new_state :: term()} | {:error, reason :: term()}
Save the specified credential to the credential storage.