- Create Microwaveprop.Valkey.Adapter behaviour with command/3 + pipeline/3 - Create Microwaveprop.Valkey.RedixAdapter as the production impl - Inject adapter via Application config; mock with Mox in tests - Cover all Valkey operations: get, mget, set, mset_with_ttl, zadd, zrevrange, zrangebyscore, zrem, del, scan_match (multi-cursor) - Full round-trip tests for encode/decode, error paths, edge cases Coverage: 78.93% → 79.07%
11 lines
483 B
Elixir
11 lines
483 B
Elixir
defmodule Microwaveprop.Valkey.Adapter do
|
|
@moduledoc """
|
|
Behaviour for the Valkey/Redis command runner. The production
|
|
implementation delegates to Redix; tests inject a Mox mock.
|
|
"""
|
|
@doc "Run a single Redis command."
|
|
@callback command(Redix.connection(), [String.t()], keyword()) :: {:ok, term()} | {:error, term()}
|
|
|
|
@doc "Run a pipeline of Redis commands."
|
|
@callback pipeline(Redix.connection(), [[String.t()]], keyword()) :: {:ok, [term()]} | {:error, term()}
|
|
end
|