Module ldclient_storage_redis_server

ldclient_storage_redis_server module.

Behaviours: gen_server.

Description

ldclient_storage_redis_server module

This is a implementation of an storage server using Redis.

Data Types

from()

from() = {pid(), term()}

state()

state() = #{client => eredis:client(), prefix => string(), buckets => list(), tag => atom()}

Function Index

all/2List all items in a bucket.
code_change/3
create/2Create a bucket.
delete/3Delete an item from the bucket by its key.
empty/2Empty a bucket.
get/3Get an item from the bucket by its key.
handle_call/3
handle_cast/2
handle_info/2
init/1
start_link/2
terminate/2
upsert/3Upsert item key value pairs in an existing bucket.
upsert_clean/3Perform an atomic empty and upsert.

Function Details

all/2

all(ServerRef::atom(), Bucket::atom()) -> [{Key::binary(), Value::any()}] | {error, bucket_not_found, string()}

List all items in a bucket

code_change/3

code_change(OldVersion, State, Extra) -> any()

create/2

create(ServerRef::atom(), Bucket::atom()) -> ok | {error, already_exists, string()}

Create a bucket

delete/3

delete(ServerRef::atom(), Bucket::atom(), Key::binary()) -> ok | {error, bucket_not_found, string()}

Delete an item from the bucket by its key

empty/2

empty(ServerRef::atom(), Bucket::atom()) -> ok | {error, bucket_not_found, string()}

Empty a bucket

get/3

get(ServerRef::atom(), Bucket::atom(), Key::binary()) -> [{Key::binary(), Value::any()}] | {error, bucket_not_found, string()}

Get an item from the bucket by its key

handle_call/3

handle_call(X1::term(), From::from(), State::state()) -> {reply, term(), state()}

handle_cast/2

handle_cast(Msg, State) -> any()

handle_info/2

handle_info(Msg, State) -> any()

init/1

init(X1) -> any()

start_link/2

start_link(WorkerRegName, Tag) -> any()

terminate/2

terminate(Reason, State) -> any()

upsert/3

upsert(ServerRef::atom(), Bucket::atom(), Items::#{Key::binary() => Value::any()}) -> ok | {error, bucket_not_found, string()}

Upsert item key value pairs in an existing bucket

upsert_clean/3

upsert_clean(ServerRef::atom(), Bucket::atom(), Items::#{Key::binary() => Value::any()}) -> ok | {error, bucket_not_found, string()}

Perform an atomic empty and upsert


Generated by EDoc