Astarte.Device.InterfaceProvider behaviour (astarte_device v1.0.0-beta.2)
This behaviour is used to implement a flexible way to retrieve interfaces for Astarte.Device
.
Link to this section Summary
Callbacks
Initialize the InterfaceProvider
and return its state.
Link to this section Types
Link to this type
state()
Specs
state() :: %{ optional(String.t()) => %Astarte.Core.Interface{ aggregate: term(), aggregation: term(), description: term(), doc: term(), interface_id: term(), interface_name: term(), major_version: term(), mappings: term(), minor_version: term(), name: term(), ownership: term(), quality: term(), type: term(), version_major: term(), version_minor: term() } }
Link to this section Callbacks
Link to this callback
init(args)
Specs
Initialize the InterfaceProvider
and return its state.
The state must be a map with the interface names as keys and the interfaces (as %Astarte.Core.Interface{}
structs) as values.
The callback can also return {:error, reason}
if its fails.