Rulestead.Store behaviour (rulestead v0.1.1)

Copy Markdown View Source

Key-first authoring store behavior for the Rulestead public API.

The contract is semantic and domain-oriented rather than CRUD-oriented. Implementations must normalize misses into {:error, %Rulestead.Error{}} and may not return nil for not-found cases.

Summary

Types

result(value)

@type result(value) :: {:ok, value} | {:error, Rulestead.Error.t()}

Callbacks

advance_rollout(t)

@callback advance_rollout(Rulestead.Store.Command.AdvanceRollout.t()) :: result(map())

apply_audience_mutation(t)

@callback apply_audience_mutation(Rulestead.Store.Command.ApplyAudienceMutation.t()) ::
  result(map())

apply_manifest_import(t)

@callback apply_manifest_import(Rulestead.Store.Command.ApplyManifestImport.t()) ::
  result(map())

apply_promotion(t)

@callback apply_promotion(Rulestead.Store.Command.ApplyPromotion.t()) :: result(map())

approve_change_request(t)

@callback approve_change_request(Rulestead.Store.Command.ApproveChangeRequest.t()) ::
  result(map())

archive_flag(t)

@callback archive_flag(Rulestead.Store.Command.ArchiveFlag.t()) :: result(map())

cancel_change_request(t)

@callback cancel_change_request(Rulestead.Store.Command.CancelChangeRequest.t()) ::
  result(map())

cancel_scheduled_execution(t)

@callback cancel_scheduled_execution(Rulestead.Store.Command.CancelScheduledExecution.t()) ::
  result(map())

compare_environments(t)

@callback compare_environments(Rulestead.Store.Command.CompareEnvironments.t()) ::
  result(map())

create_flag(t)

@callback create_flag(Rulestead.Store.Command.CreateFlag.t()) :: result(map())

create_webhook_destination(t)

@callback create_webhook_destination(Rulestead.Store.Command.CreateWebhookDestination.t()) ::
  result(map())

engage_kill_switch(t)

@callback engage_kill_switch(Rulestead.Store.Command.EngageKillSwitch.t()) ::
  result(map())

evaluate_guarded_rollout(t)

@callback evaluate_guarded_rollout(Rulestead.Store.Command.EvaluateGuardedRollout.t()) ::
  result(map())

evaluate_rollout_auto_advance(t)

@callback evaluate_rollout_auto_advance(
  Rulestead.Store.Command.EvaluateRolloutAutoAdvance.t()
) ::
  result(map())

execute_change_request(t)

@callback execute_change_request(Rulestead.Store.Command.ExecuteChangeRequest.t()) ::
  result(map())

execute_scheduled_execution(t)

@callback execute_scheduled_execution(
  Rulestead.Store.Command.ExecuteScheduledExecution.t()
) ::
  result(map())

fetch_change_request(t)

@callback fetch_change_request(Rulestead.Store.Command.FetchChangeRequest.t()) ::
  result(map())

fetch_flag(t)

@callback fetch_flag(Rulestead.Store.Command.FetchFlag.t()) :: result(map())

fetch_guardrail_status(t)

@callback fetch_guardrail_status(Rulestead.Store.Command.FetchGuardrailStatus.t()) ::
  result(map())

fetch_rollout_auto_advance_policy(t)

@callback fetch_rollout_auto_advance_policy(
  Rulestead.Store.Command.FetchRolloutAutoAdvancePolicy.t()
) ::
  result(map())

fetch_scheduled_execution(t)

@callback fetch_scheduled_execution(Rulestead.Store.Command.FetchScheduledExecution.t()) ::
  result(map())

fetch_snapshot(t)

@callback fetch_snapshot(Rulestead.Store.Command.FetchSnapshot.t()) :: result(map())

fetch_webhook_destination(t)

@callback fetch_webhook_destination(Rulestead.Store.Command.FetchWebhookDestination.t()) ::
  result(map())

fetch_webhook_record(t)

@callback fetch_webhook_record(Rulestead.Store.Command.FetchWebhookRecord.t()) ::
  result(map())

list_audience_dependencies(t)

@callback list_audience_dependencies(Rulestead.Store.Command.ListAudienceDependencies.t()) ::
  result(map())

list_audiences(t)

@callback list_audiences(Rulestead.Store.Command.ListAudiences.t()) :: result([map()])

list_audit_events(t)

@callback list_audit_events(Rulestead.Store.Command.ListAuditEvents.t()) ::
  result(Rulestead.Store.Command.Page.t(map()))

list_change_requests(t)

@callback list_change_requests(Rulestead.Store.Command.ListChangeRequests.t()) ::
  result(Rulestead.Store.Command.Page.t(map()))

list_environments(t)

@callback list_environments(Rulestead.Store.Command.ListEnvironments.t()) ::
  result([map()])

list_flags(t)

@callback list_flags(Rulestead.Store.Command.ListFlags.t()) ::
  result(Rulestead.Store.Command.Page.t(map()))

list_scheduled_executions(t)

@callback list_scheduled_executions(Rulestead.Store.Command.ListScheduledExecutions.t()) ::
  result(Rulestead.Store.Command.Page.t(map()))

list_webhook_deliveries(t)

@callback list_webhook_deliveries(Rulestead.Store.Command.ListWebhookDeliveries.t()) ::
  result(Rulestead.Store.Command.Page.t(map()))

list_webhook_destinations(t)

@callback list_webhook_destinations(Rulestead.Store.Command.ListWebhookDestinations.t()) ::
  result(Rulestead.Store.Command.Page.t(map()))

list_webhook_records(t)

@callback list_webhook_records(Rulestead.Store.Command.ListWebhookRecords.t()) ::
  result(Rulestead.Store.Command.Page.t(map()))

preview_audience_impact(t)

@callback preview_audience_impact(Rulestead.Store.Command.PreviewAudienceImpact.t()) ::
  result(map())

preview_manifest_import(t)

@callback preview_manifest_import(Rulestead.Store.Command.PreviewManifestImport.t()) ::
  result(map())

publish_ruleset(t)

@callback publish_ruleset(Rulestead.Store.Command.PublishRuleset.t()) :: result(map())

receive_inbound_webhook(t)

@callback receive_inbound_webhook(Rulestead.Store.Command.ReceiveInboundWebhook.t()) ::
  result(map())

record_evaluation(t)

@callback record_evaluation(Rulestead.Store.Command.RecordEvaluation.t()) :: result(map())

reject_change_request(t)

@callback reject_change_request(Rulestead.Store.Command.RejectChangeRequest.t()) ::
  result(map())

release_kill_switch(t)

@callback release_kill_switch(Rulestead.Store.Command.ReleaseKillSwitch.t()) ::
  result(map())

requeue_scheduled_execution(t)

@callback requeue_scheduled_execution(
  Rulestead.Store.Command.RequeueScheduledExecution.t()
) ::
  result(map())

retry_webhook_delivery(t)

@callback retry_webhook_delivery(Rulestead.Store.Command.RetryWebhookDelivery.t()) ::
  result(map())

rollback_audit_event(t)

@callback rollback_audit_event(Rulestead.Store.Command.RollbackAuditEvent.t()) ::
  result(map())

save_draft_ruleset(t)

@callback save_draft_ruleset(Rulestead.Store.Command.SaveDraftRuleset.t()) ::
  result(map())

schedule_change_request(t)

@callback schedule_change_request(Rulestead.Store.Command.ScheduleChangeRequest.t()) ::
  result(map())

schedule_governed_action(t)

@callback schedule_governed_action(Rulestead.Store.Command.ScheduleGovernedAction.t()) ::
  result(map())

submit_change_request(t)

@callback submit_change_request(Rulestead.Store.Command.SubmitChangeRequest.t()) ::
  result(map())

update_flag(t)

@callback update_flag(Rulestead.Store.Command.UpdateFlag.t()) :: result(map())

update_webhook_destination(t)

@callback update_webhook_destination(Rulestead.Store.Command.UpdateWebhookDestination.t()) ::
  result(map())

upsert_rollout_auto_advance_policy(t)

@callback upsert_rollout_auto_advance_policy(
  Rulestead.Store.Command.UpsertRolloutAutoAdvancePolicy.t()
) ::
  result(map())