Runlet.History (runlet v1.2.7)

View Source

Runlet command history tracked by user

Summary

Functions

Add an item into a user's history.

Complete history for a user.

Delete an item or items from a user's history.

Return the history for a user corresponding to a number or a list of numbers.

Types

t()

@type t() :: {binary(), any()}

Functions

add(user, key, val)

@spec add(binary(), binary(), any()) :: :ok | {:error, any()}

Add an item into a user's history.

all(user)

@spec all(binary()) :: [binary()]

Complete history for a user.

delete(user, index)

@spec delete(binary(), integer() | [integer()]) :: :ok | {:error, any()}

Delete an item or items from a user's history.

lookup(user, index)

@spec lookup(binary(), integer() | [integer()]) :: nil | t() | [t()]

Return the history for a user corresponding to a number or a list of numbers.