Runlet.State (runlet v1.2.7)

View Source

Persistent state storage for processes

Summary

Functions

Add key/value to user state file.

Characters escaped by percent encoding. Allows @.

Decode identifier from percent encoding.

Remove key in user's state file.

Percent encode identifier in a filesystem safe format.

Test if a state dir for a user exists.

Test if a given state file exists for a user.

Storage location for runlet state.

Lists all entries in a state file for a user.

Functions

add(type, id, key, val)

@spec add(String.t(), String.t(), any(), any()) :: :ok | {:error, any()}

Add key/value to user state file.

add(dir, type, id, key, val)

char_reserved?(char)

@spec char_reserved?(byte()) :: boolean()

Characters escaped by percent encoding. Allows @.

decode(user)

@spec decode(binary()) :: binary()

Decode identifier from percent encoding.

delete(type, id, key)

@spec delete(String.t(), String.t(), any()) :: :ok | {:error, any()}

Remove key in user's state file.

delete(dir, type, id, key)

encode(user)

@spec encode(binary()) :: binary()

Percent encode identifier in a filesystem safe format.

exists?(id)

@spec exists?(String.t()) :: boolean()

Test if a state dir for a user exists.

exists?(type, id)

@spec exists?(String.t(), String.t()) :: boolean()

Test if a given state file exists for a user.

path()

@spec path() :: binary()

Storage location for runlet state.

table(type, id)

@spec table(String.t(), String.t()) :: [tuple()]

Lists all entries in a state file for a user.

table(dir, type, id)

@spec table(binary(), String.t(), String.t()) :: [tuple()]