plug_mishka_auth v0.0.2 MishkaAuth.RedisClient View Source
You will be able to handle Redis with this module, it has CRUD functions to use Redis, it should be noted it does your work with easy way
Link to this section Summary
Functions
delete singel field of redis record
delete redis record
show all fields of redis record
get expire time of singel record
show singel fields of redis record
with this function you can connect to redis file for example redis-server redis.conf
,
its password was put like hardcode. you should change it in future.
get expire time of singel record
Link to this section Functions
Specs
convert_output_of_get_all_fields_of_record_redis(maybe_improper_list()) :: {:error, :get_all_fields_of_record_redis, <<_::256>>} | {:ok, :get_all_fields_of_record_redis, any()}
Specs
delete_field_of_record_redis(binary(), binary(), any()) :: {:error, atom() | %{ :__exception__ => any(), :__struct__ => Redix.ConnectionError | Redix.Error, optional(:message) => binary(), optional(:reason) => atom() }} | {:ok, :delete_field_of_record_redis | [ nil | binary() | [nil | binary() | [any()] | integer() | map()] | integer() | Redix.Error.t() ]} | {:error, :delete_field_of_record_redis | :get_all_fields_of_record_redis, <<_::256>>}
delete singel field of redis record
Specs
delete_record_of_redis(binary(), binary()) :: {:error, :get_all_fields_of_record_redis, <<_::256>>} | {:ok, :delete_record_of_redis, <<_::168>>}
delete redis record
Specs
get_all_fields_of_record_redis(binary(), binary()) :: [ nil | binary() | [nil | binary() | [any()] | integer() | Redix.Error.t()] | integer() | Redix.Error.t() ]
show all fields of redis record
Specs
Specs
get_expire_time_of_redis(binary(), binary()) :: {:error, :get_expire_time_error_handler, <<_::256>>} | {:ok, :get_expire_time, nil | binary() | [nil | binary() | [any()] | integer() | map()] | integer() | Redix.Error.t()}
get expire time of singel record
get_singel_field_record_of_redis(table_name, record_id, field_name)
View SourceSpecs
get_singel_field_record_of_redis(any(), any(), any()) :: [ nil | binary() | [nil | binary() | [any()] | integer() | Redix.Error.t()] | integer() | Redix.Error.t() ]
show singel fields of redis record
insert_or_update_into_redis(table_name, record_id, params, expire_time)
View SourceSpecs
insert_or_update_into_redis(binary(), binary(), map(), any()) :: {:ok, :insert_or_update_into_redis}
with this function you can connect to redis file for example redis-server redis.conf
,
its password was put like hardcode. you should change it in future.
def connect_to_redis do
Redix.pipeline(:redix, [["AUTH","9GXXnt2qtqLv7p2fYvBWE1kAWif1OXRMHOL/7IoSvCLBF5v0+eCwasYXGeeoxaT6KAQE8HB0jCwcoz+6"]]) # will be changed
end
this function can be used ether insering data to redis or update data, the type of expire_time is seconds. the params type is Map - tuple.
Specs
update_expire_time_of_redis(binary(), binary(), any()) :: {:error, :update_expire_time_of_error_handler, <<_::256>>} | {:ok, :update_expire_time_of_redis, <<_::240>>}
get expire time of singel record