View Source Runlet.State (runlet v1.2.5)

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

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

Add key/value to user state file.

Link to this function

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

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

Characters escaped by percent encoding. Allows @.

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

Decode identifier from percent encoding.

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

Remove key in user's state file.

Link to this function

delete(dir, type, id, key)

View Source
@spec encode(binary()) :: binary()

Percent encode identifier in a filesystem safe format.

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

Test if a state dir for a user exists.

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

Test if a given state file exists for a user.

@spec path() :: binary()

Storage location for runlet state.

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

Lists all entries in a state file for a user.

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