FragmentedKeys.Key (fragmented_keys v0.1.1)

Copy Markdown View Source

A composite cache key built from multiple versioned tags.

The final key string is an MD5 hash of the base key name combined with each tag's name and current version, so that any tag version change produces a completely different key.

Summary

Functions

Append a tag to this key's composition. Returns updated key.

Build the composite key string.

Create a new composite key from a name and list of tags.

Types

t()

@type t() :: %FragmentedKeys.Key{
  group_id: String.t(),
  key: String.t(),
  tags: [struct()]
}

Functions

add_tag(k, tag)

Append a tag to this key's composition. Returns updated key.

get_key_str(key, hash \\ true)

Build the composite key string.

When hash is true (default) the key is returned as an MD5 hex digest suitable for use as a cache key. Pass false to get the raw string for debugging.

new(key, tags \\ [], opts \\ [])

Create a new composite key from a name and list of tags.