-module(radish@command@hash). -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). -export([set/2, set_new/3, keys/1, len/1, get/2, get_all/1, mget/2, strlen/2, vals/1, del/2, exists/2, incr_by/3, incr_by_float/3, scan/3, scan_pattern/4]). -file("/home/massivefermion/Desktop/radish/src/radish/command/hash.gleam", 7). -spec set(binary(), list({binary(), binary()})) -> bitstring(). set(Key, Fields) -> _pipe = [<<"HSET"/utf8>>, Key], _pipe@1 = lists:append( _pipe, gleam@list:flat_map( Fields, fun(Kv) -> [erlang:element(1, Kv), erlang:element(2, Kv)] end ) ), radish@utils:prepare(_pipe@1). -file("/home/massivefermion/Desktop/radish/src/radish/command/hash.gleam", 13). -spec set_new(binary(), binary(), binary()) -> bitstring(). set_new(Key, Field, Value) -> _pipe = [<<"HSETNX"/utf8>>, Key, Field, Value], radish@utils:prepare(_pipe). -file("/home/massivefermion/Desktop/radish/src/radish/command/hash.gleam", 18). -spec keys(binary()) -> bitstring(). keys(Key) -> _pipe = [<<"HKEYS"/utf8>>, Key], radish@utils:prepare(_pipe). -file("/home/massivefermion/Desktop/radish/src/radish/command/hash.gleam", 23). -spec len(binary()) -> bitstring(). len(Key) -> _pipe = [<<"HLEN"/utf8>>, Key], radish@utils:prepare(_pipe). -file("/home/massivefermion/Desktop/radish/src/radish/command/hash.gleam", 28). -spec get(binary(), binary()) -> bitstring(). get(Key, Field) -> _pipe = [<<"HGET"/utf8>>, Key, Field], radish@utils:prepare(_pipe). -file("/home/massivefermion/Desktop/radish/src/radish/command/hash.gleam", 33). -spec get_all(binary()) -> bitstring(). get_all(Key) -> _pipe = [<<"HGETALL"/utf8>>, Key], radish@utils:prepare(_pipe). -file("/home/massivefermion/Desktop/radish/src/radish/command/hash.gleam", 38). -spec mget(binary(), list(binary())) -> bitstring(). mget(Key, Fields) -> _pipe = [<<"HMGET"/utf8>>, Key], _pipe@1 = lists:append(_pipe, Fields), radish@utils:prepare(_pipe@1). -file("/home/massivefermion/Desktop/radish/src/radish/command/hash.gleam", 44). -spec strlen(binary(), binary()) -> bitstring(). strlen(Key, Field) -> _pipe = [<<"HSTRLEN"/utf8>>, Key, Field], radish@utils:prepare(_pipe). -file("/home/massivefermion/Desktop/radish/src/radish/command/hash.gleam", 49). -spec vals(binary()) -> bitstring(). vals(Key) -> _pipe = [<<"HVALS"/utf8>>, Key], radish@utils:prepare(_pipe). -file("/home/massivefermion/Desktop/radish/src/radish/command/hash.gleam", 54). -spec del(binary(), list(binary())) -> bitstring(). del(Key, Fields) -> _pipe = [<<"HDEL"/utf8>>, Key], _pipe@1 = lists:append(_pipe, Fields), radish@utils:prepare(_pipe@1). -file("/home/massivefermion/Desktop/radish/src/radish/command/hash.gleam", 60). -spec exists(binary(), binary()) -> bitstring(). exists(Key, Field) -> _pipe = [<<"HEXISTS"/utf8>>, Key, Field], radish@utils:prepare(_pipe). -file("/home/massivefermion/Desktop/radish/src/radish/command/hash.gleam", 65). -spec incr_by(binary(), binary(), integer()) -> bitstring(). incr_by(Key, Field, Value) -> _pipe = [<<"HINCRBY"/utf8>>, Key, Field, erlang:integer_to_binary(Value)], radish@utils:prepare(_pipe). -file("/home/massivefermion/Desktop/radish/src/radish/command/hash.gleam", 70). -spec incr_by_float(binary(), binary(), float()) -> bitstring(). incr_by_float(Key, Field, Value) -> _pipe = [<<"HINCRBYFLOAT"/utf8>>, Key, Field, gleam_stdlib:float_to_string(Value)], radish@utils:prepare(_pipe). -file("/home/massivefermion/Desktop/radish/src/radish/command/hash.gleam", 75). -spec scan(binary(), integer(), integer()) -> bitstring(). scan(Key, Cursor, Count) -> _pipe = [<<"HSCAN"/utf8>>, Key, erlang:integer_to_binary(Cursor), <<"COUNT"/utf8>>, erlang:integer_to_binary(Count)], radish@utils:prepare(_pipe). -file("/home/massivefermion/Desktop/radish/src/radish/command/hash.gleam", 80). -spec scan_pattern(binary(), integer(), binary(), integer()) -> bitstring(). scan_pattern(Key, Cursor, Pattern, Count) -> _pipe = [<<"HSCAN"/utf8>>, Key, erlang:integer_to_binary(Cursor), <<"MATCH"/utf8>>, Pattern, <<"COUNT"/utf8>>, erlang:integer_to_binary(Count)], radish@utils:prepare(_pipe).