k8s v0.5.2 K8s.Resource.NamedList

Provides an accessor to a list of maps whereas each element in the list has a key named "name". The name should be unique within the list and therefore defining the element.

Examples

iex> get_in([%{"name" => "key1", "value" => "value1"}, %{"name" => "key2", "value" => "value2"}], [K8s.Resource.NamedList.access("key2"), "value"]) "value2"

iex> put_in([%{"name" => "key1", "value" => "value1"}, %{"name" => "key2", "value" => "value2"}], [K8s.Resource.NamedList.access("key1"), "value"], "value_new") [%{"name" => "key1", "value" => "value_new"}, %{"name" => "key2", "value" => "value2"}]

iex> pop_in([%{"name" => "key1", "value" => "value1"}, %{"name" => "key2", "value" => "value2"}], [K8s.Resource.NamedList.access("key1"), "value"]) {"value1", [%{"name" => "key1"}, %{"name" => "key2", "value" => "value2"}]}

Link to this section Summary

Link to this section Functions

Link to this function

access(name)

access(binary()) :: Access.access_fun(data :: list(), get_value :: term())