antikythera v0.3.0 AntikytheraCore.Config.Gear View Source
Link to this section Summary
Functions
Type-aware getter for alerts.
Type-aware setter for alerts.
Type-aware getter for domains.
Type-aware setter for domains.
Type-aware getter for kv.
Type-aware setter for kv.
Type-aware getter for log_level.
Type-aware setter for log_level.
Creates a new instance of AntikytheraCore.Config.Gear by using the given dict.
A variant of new/1 which returns t or raise if validation fails.
Updates an existing instance of AntikytheraCore.Config.Gear 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
t()
View Sourcet() :: %AntikytheraCore.Config.Gear{
alerts: AntikytheraCore.Alert.HandlerConfigsMap.t(),
domains: Antikythera.DomainList.t(),
kv: Croma.Map.t(),
log_level: AntikytheraCore.GearLog.Level.t()
}
Link to this section Functions
alerts(gear)
View Sourcealerts(t()) :: AntikytheraCore.Alert.HandlerConfigsMap.t()
Type-aware getter for alerts.
alerts(s, field)
View Sourcealerts(t(), AntikytheraCore.Alert.HandlerConfigsMap.t()) :: t()
Type-aware setter for alerts.
Type-aware getter for domains.
Type-aware setter for domains.
ensure_loaded(gear_name)
View Sourceensure_loaded(Antikythera.GearName.t()) :: :ok
Type-aware getter for kv.
Type-aware setter for kv.
load_all(last_checked_at)
View Sourceload_all(Antikythera.SecondsSinceEpoch.t()) :: :ok
log_level(gear)
View Sourcelog_level(t()) :: AntikytheraCore.GearLog.Level.t()
Type-aware getter for log_level.
log_level(s, field)
View Sourcelog_level(t(), AntikytheraCore.GearLog.Level.t()) :: t()
Type-aware setter for log_level.
Creates a new instance of AntikytheraCore.Config.Gear by using the given dict.
Returns {:ok, valid_struct} or {:error, reason}.
The values in the dict are validated by each field's valid?/1 function.
If the value was invalid, it will be passed to new/1 of the field
For missing fields, followings will be tried:
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 AntikytheraCore.Config.Gear 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.
write(gear_name, config)
View Sourcewrite(Antikythera.GearName.t(), t()) :: :ok