VertexCacheSdk.Command.Impl.SetCommand (vertexcache_sdk v1.0.0)

View Source

Handles the SET command in VertexCache.

Stores a value in the cache under the specified key, optionally assigning secondary (idx1) and tertiary (idx2) indexes for lookup. Existing keys will be overwritten. Supports expiration and format validation if configured.

Requires the client to have WRITE or ADMIN access.

Validation:

  • Primary key and value are required.
  • If secondary index is provided, it must be non-blank.
  • If tertiary index is used, secondary index must also be present and non-blank.

Summary

Types

t()

@type t() :: %VertexCacheSdk.Command.Impl.SetCommand{
  primary_key: String.t(),
  secondary_key: String.t() | nil,
  tertiary_key: String.t() | nil,
  value: String.t()
}

Functions

build_command(set_command)

@spec build_command(t()) :: String.t()

execute(cmd, connector)

@spec execute(t(), VertexCacheSdk.Comm.ClientConnector.t()) ::
  VertexCacheSdk.Model.CommandResult.t()

new(primary_key, value)

@spec new(String.t(), String.t()) :: t()

new(primary_key, value, idx1)

@spec new(String.t(), String.t(), String.t()) :: t()

new(primary_key, value, idx1, idx2)

@spec new(String.t(), String.t(), String.t() | nil, String.t() | nil) :: t()

parse_response(arg1)

@spec parse_response(String.t()) :: :ok | no_return()

Callback implementation for VertexCacheSdk.Command.parse_response/1.