tus_cache_redis v0.1.0 Tus.Cache.Redis

Redis cache backend for the Tus server

Uses the Redix package for interfacing with Redis.

Installation

The package can be installed by adding tus_cache_redis to your list of dependencies in mix.exs:

def deps do
  [
    {:tus, "~> 0.1.0"},
    {:tus_cache_redis, "~> 0.1.0"},
  ]
end

Configuration

  • cache: Set it as Tus.Cache.Redis.
  • redis_host: Optional. “localhost” by default
  • redis_port: Optional. 6379 by default.

Link to this section Summary

Functions

Delete a value from Redis. Doesn’t fail if the key doesn’t exist, so it can be called multiple times

Read a value from Redis. Returns nil is none is found

Puts a value to Redis. Overwrites any value with the same key

Start the Redix GenServer

Link to this section Functions

Link to this function delete(name, key)

Delete a value from Redis. Doesn’t fail if the key doesn’t exist, so it can be called multiple times.

Read a value from Redis. Returns nil is none is found.

Link to this function put(name, key, file)

Puts a value to Redis. Overwrites any value with the same key.

Link to this function start_link(config)

Start the Redix GenServer.

Params:

  • :redis_host: “localhost”
  • :redis_port: 6379
  • :cache_name: The name of the server