rafted_value v0.1.1 RaftedValue.Config

Summary

Functions

Type-aware getter for communication_module

Type-aware setter for communication_module

Type-aware getter for data_module

Type-aware setter for data_module

Type-aware getter for election_timeout

Type-aware setter for election_timeout

Type-aware getter for election_timeout_clock_drift_margin

Type-aware setter for election_timeout_clock_drift_margin

Type-aware getter for heartbeat_timeout

Type-aware setter for heartbeat_timeout

Type-aware getter for leader_hook_module

Type-aware setter for leader_hook_module

Type-aware getter for max_retained_command_results

Type-aware setter for max_retained_command_results

Type-aware getter for max_retained_committed_logs

Type-aware setter for max_retained_committed_logs

Creates a new instance of Elixir.RaftedValue.Config by using the given dict and the default value of each field. Returns {:ok, valid_struct} or {:error, reason}. The values in the dict are validated by each field’s validate/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

Updates an existing instance of Elixir.RaftedValue.Config with the given dict. The values in the dict are validated by each field’s validate/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 that the given dict is valid or not by using each field’s validate/1 function. Returns {:ok, valid_struct} or {:error, reason}

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

Types

t :: %RaftedValue.Config{communication_module: Croma.Atom.t, data_module: Croma.Atom.t, election_timeout: Croma.PosInteger.t, election_timeout_clock_drift_margin: Croma.PosInteger.t, heartbeat_timeout: Croma.PosInteger.t, leader_hook_module: Croma.Atom.t, max_retained_command_results: Croma.PosInteger.t, max_retained_committed_logs: Croma.PosInteger.t}

Functions

communication_module(config)

Specs

communication_module(t) :: Croma.Atom.t

Type-aware getter for communication_module.

communication_module(s, field)

Specs

communication_module(t, Croma.Atom.t) :: t

Type-aware setter for communication_module.

data_module(config)

Specs

data_module(t) :: Croma.Atom.t

Type-aware getter for data_module.

data_module(s, field)

Specs

data_module(t, Croma.Atom.t) :: t

Type-aware setter for data_module.

election_timeout(config)

Specs

election_timeout(t) :: Croma.PosInteger.t

Type-aware getter for election_timeout.

election_timeout(s, field)

Specs

election_timeout(t, Croma.PosInteger.t) :: t

Type-aware setter for election_timeout.

election_timeout_clock_drift_margin(config)

Specs

election_timeout_clock_drift_margin(t) :: Croma.PosInteger.t

Type-aware getter for election_timeout_clock_drift_margin.

election_timeout_clock_drift_margin(s, field)

Specs

election_timeout_clock_drift_margin(t, Croma.PosInteger.t) :: t

Type-aware setter for election_timeout_clock_drift_margin.

heartbeat_timeout(config)

Specs

heartbeat_timeout(t) :: Croma.PosInteger.t

Type-aware getter for heartbeat_timeout.

heartbeat_timeout(s, field)

Specs

heartbeat_timeout(t, Croma.PosInteger.t) :: t

Type-aware setter for heartbeat_timeout.

leader_hook_module(config)

Specs

leader_hook_module(t) :: Croma.Atom.t

Type-aware getter for leader_hook_module.

leader_hook_module(s, field)

Specs

leader_hook_module(t, Croma.Atom.t) :: t

Type-aware setter for leader_hook_module.

max_retained_command_results(config)

Specs

max_retained_command_results(t) :: Croma.PosInteger.t

Type-aware getter for max_retained_command_results.

max_retained_command_results(s, field)

Specs

max_retained_command_results(t, Croma.PosInteger.t) :: t

Type-aware setter for max_retained_command_results.

max_retained_committed_logs(config)

Specs

max_retained_committed_logs(t) :: Croma.PosInteger.t

Type-aware getter for max_retained_committed_logs.

max_retained_committed_logs(s, field)

Specs

max_retained_committed_logs(t, Croma.PosInteger.t) :: t

Type-aware setter for max_retained_committed_logs.

new(dict)

Specs

new(Dict.t) :: Croma.Result.t(t)

Creates a new instance of Elixir.RaftedValue.Config by using the given dict and the default value of each field. Returns {:ok, valid_struct} or {:error, reason}. The values in the dict are validated by each field’s validate/1 function.

new!(dict)

Specs

new!(Dict.t) :: t

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

update(s, dict)

Specs

update(t, Dict.t) :: Croma.Result.t(t)

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

update!(s, dict)

Specs

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.

validate(dict)

Specs

validate(Dict.t) :: Croma.Result.t(t)

Checks that the given dict is valid or not by using each field’s validate/1 function. Returns {:ok, valid_struct} or {:error, reason}.

validate!(dict)

Specs

validate!(Dict.t) :: t

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