FileConfig (file_config v0.7.1)

Copy Markdown View Source

Public API

Summary

Types

continuation()

@type continuation() :: term()

reason()

@type reason() :: atom() | binary()

table_name()

@type table_name() :: atom()

version()

@opaque version()

Functions

all(table_name, match_limit \\ 500)

@spec all(table_name(), pos_integer()) :: [term()]

flush(table_name)

@spec flush(table_name()) :: :ok | {:error, reason()}

insert(table_name, records)

@spec insert(table_name(), {term(), term()} | [{term(), term()}]) ::
  :ok | {:error, reason()}

Insert one or more records

read(table_name, key)

@spec read(table_name(), term()) :: {:ok, term()} | nil | {:error, reason()}

Read value from table

read_all(table_name, match_limit \\ 500)

@spec read_all(table_name(), pos_integer()) :: {:ok, list()}

Return all records

table_info(table_name)

@spec table_info(table_name()) ::
  {:ok, FileConfig.Loader.table_state()} | {:error, :unknown_table}

Get all data from index

version(table_name)

@spec version(table_name()) :: version()

version(table_name, arg)

@spec version(table_name(), version()) :: :current | :old