ExAgent.Database behaviour

Basic database module providing minimal functions.

Source

Summary

load_database(file)

Parses a yaml database file and returns the contents

Functions

load_database(file)

Specs:

Parses a yaml database file and returns the contents.

Source

Callbacks

init/0

Specs:

  • init :: atom | :ets.tid

Initializes (sets up) the database.

Source
list/0

Specs:

  • list :: list

Returns all database entries as a list.

Source
load/1

Specs:

Loads a database file.

Source
parse_database/1

Specs:

  • parse_database(list) :: :ok

Traverses the database and passes each entry to the storage function.

Source
sources/0

Specs:

  • sources :: list

Returns the database sources.

Source
store_entry/1

Specs:

  • store_entry(any) :: boolean

Stores a database entry.

If necessary a data conversion is made from the raw data passed directly out of the database file and the actual data needed when querying the database.

Source
terminate/0

Specs:

  • terminate :: true

Terminates (deletes) the database.

Source