Astarte.Device.SimpleInterfaceProvider (astarte_device v1.0.0-beta.2)
Link to this section Summary
Functions
Get the list of all interfaces in the provider.
Get the list of all device owned interfaces in the provider.
Returns the interface with name name
by calling all_interfaces/1
and filtering the result.
Get the interface by its name.
Loads interfaces from a list of maps, each representing the JSON serialization of an interface.
Get the list of all server owned interfaces in the provider.
Link to this section Functions
all_interfaces(state)
Specs
all_interfaces(state :: Astarte.Device.InterfaceProvider.state()) :: [ %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() } ]
Get the list of all interfaces in the provider.
device_owned_interfaces(state)
Specs
device_owned_interfaces(state :: Astarte.Device.InterfaceProvider.state()) :: [ %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() } ]
Get the list of all device owned interfaces in the provider.
fetch_interface(name, state)
Specs
fetch_interface( name :: String.t(), state :: Astarte.Device.InterfaceProvider.state() ) :: {:ok, %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() }} | :error
Returns the interface with name name
by calling all_interfaces/1
and filtering the result.
Get the interface by its name.
Returns {:ok, %Interface{}}
if the interface is found, :error
if it's not.
init(args)
Loads interfaces from a list of maps, each representing the JSON serialization of an interface.
Returns {:ok, interfaces}
where interfaces
is a map of interface_name => %Astarte.Core.Interface{}
or {:error, reason}
if an interface can't be loaded.
args
is a keyword list of options.
Options
interfaces
- A list of maps representing an interface.
server_owned_interfaces(state)
Specs
server_owned_interfaces(state :: Astarte.Device.InterfaceProvider.state()) :: [ %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() } ]
Get the list of all server owned interfaces in the provider.