View Source erldns_storage_json (erldns v4.2.0)

Summary

Functions

Backup a specific ets table. https://github.com/SiftLogic/erl-dns/issues/3

Should backup all ets tables. https://github.com/SiftLogic/erl-dns/issues/3

Create ets table wrapper. Use match cases for adding different options to the table.

Delete an entry in the ets table.Ets always returns true for this function.

Delete entire ets table.

Empty ets table. Ets always returns true for this function.

Wrapper for foldl in ets.

Insert value in ets table.

Lists the ets table

Select from ets using key, value.

Delete entries in the ets table that match the provided spec.

Functions

backup_table(Table)

-spec backup_table(atom()) -> ok | {error, Reason :: term()}.

Backup a specific ets table. https://github.com/SiftLogic/erl-dns/issues/3

backup_tables()

-spec backup_tables() -> ok | {error, Reason :: term()}.

Should backup all ets tables. https://github.com/SiftLogic/erl-dns/issues/3

create(Name)

-spec create(atom()) -> ok | not_implemented | {error, Reason :: term()}.

Create ets table wrapper. Use match cases for adding different options to the table.

delete(Table, Key)

-spec delete(atom(), term()) -> ok.

Delete an entry in the ets table.Ets always returns true for this function.

delete_table(Table)

-spec delete_table(atom()) -> ok.

Delete entire ets table.

empty_table(Table)

-spec empty_table(atom()) -> ok.

Empty ets table. Ets always returns true for this function.

foldl(Fun, Acc, Table)

-spec foldl(fun(), list(), atom()) -> Acc :: term() | {error, Reason :: term()}.

Wrapper for foldl in ets.

insert(Table, Value)

-spec insert(atom(), tuple()) -> ok.

Insert value in ets table.

list_table(TableName)

-spec list_table(atom()) -> term() | {error, term()}.

Lists the ets table

select(Table, Key)

-spec select(atom(), term()) -> [tuple()].

Select from ets using key, value.

select(Table, MatchSpec, Limit)

-spec select(atom(), list(), integer() | infinite) -> tuple() | '$end_of_table'.

select_delete(Table, MatchSpec)

-spec select_delete(atom(), list()) -> {ok, Count :: integer()} | {error, Reason :: term()}.

Delete entries in the ets table that match the provided spec.