dist_agent v0.1.1 DistAgent.Quota View Source

Link to this section Summary

Functions

Type-aware getter for limits_map

Type-aware setter for limits_map

Creates a new instance of DistAgent.Quota by using the given dict

A variant of new/1 which returns t or raise if validation fails

Type-aware getter for nodes_map

Type-aware setter for nodes_map

Updates an existing instance of DistAgent.Quota with the given dict. The values in the dict are validated by each field’s valid?/1 function. Returns {:ok, valid_struct} or {:error, reason}

A variant of update/2 which returns t or raise if validation fails. In other words, update/2 followed by Croma.Result.get!/1

Checks if the given value belongs to t/0 or not

Link to this section Types

Link to this type t() View Source
t() :: %DistAgent.Quota{
  limits_map: DistAgent.Quota.LimitsMap.t(),
  nodes_map: DistAgent.Quota.NodesMap.t()
}

Link to this section Functions

Link to this function add_consensus_group() View Source
add_consensus_group() :: :ok | {:error, :already_added}

Type-aware getter for limits_map.

Link to this function limits_map(s, field) View Source
limits_map(t(), DistAgent.Quota.LimitsMap.t()) :: t()

Type-aware setter for limits_map.

Creates a new instance of DistAgent.Quota by using the given dict.

For missing fields, default/0 of each field type will be used.

Returns {:ok, valid_struct} or {:error, reason}. The values in the dict are validated by each field’s valid?/1 function.

A variant of new/1 which returns t or raise if validation fails.

In other words, new/1 followed by Croma.Result.get!/1.

Type-aware getter for nodes_map.

Link to this function nodes_map(s, field) View Source
nodes_map(t(), DistAgent.Quota.NodesMap.t()) :: t()

Type-aware setter for nodes_map.

Link to this function query_status(a0) View Source
query_status(DistAgent.Id.t()) :: :ok | :not_found | :limit_reached

Updates an existing instance of DistAgent.Quota with the given dict. The values in the dict are validated by each field’s valid?/1 function. Returns {:ok, valid_struct} or {:error, reason}.

Link to this function update!(s, dict) View Source
update!(t(), Dict.t()) :: t()

A variant of update/2 which returns t or raise if validation fails. In other words, update/2 followed by Croma.Result.get!/1.

Checks if the given value belongs to t/0 or not.