Workflow run 账本后端 behaviour 与默认包装函数。
cmdc_orchestrator 只定义通用接口和 ETS 开发后端;企业 Phoenix 平台可以
自行实现 Ecto/Oban/审计集成后端。
Summary
Functions
解析 RunStore 后端。
Types
@type backend() :: module()
Callbacks
@callback append_event( String.t(), CMDCOrchestrator.RunEvent.t() | {String.t() | atom(), map()} | map() ) :: {:ok, CMDCOrchestrator.RunEvent.t()} | {:error, term()}
@callback list_events( String.t(), keyword() ) :: {:ok, [CMDCOrchestrator.RunEvent.t()]} | {:error, term()}
@callback list_node_runs(String.t()) :: {:ok, [CMDCOrchestrator.NodeRun.t()]} | {:error, term()}
@callback list_runs(keyword()) :: {:ok, [CMDCOrchestrator.Run.t()]} | {:error, term()}
@callback load_run(String.t()) :: {:ok, CMDCOrchestrator.Run.t()} | {:error, term()}
@callback save_run(CMDCOrchestrator.Run.t()) :: {:ok, CMDCOrchestrator.Run.t()} | {:error, term()}
@callback update_node_run( String.t(), String.t(), map() | (CMDCOrchestrator.NodeRun.t() -> CMDCOrchestrator.NodeRun.t()) ) :: {:ok, CMDCOrchestrator.NodeRun.t()} | {:error, term()}
@callback update_run( String.t(), map() | (CMDCOrchestrator.Run.t() -> CMDCOrchestrator.Run.t()) ) :: {:ok, CMDCOrchestrator.Run.t()} | {:error, term()}
@callback upsert_node_run(CMDCOrchestrator.NodeRun.t()) :: {:ok, CMDCOrchestrator.NodeRun.t()} | {:error, term()}
Functions
@spec append_event( backend(), String.t(), CMDCOrchestrator.RunEvent.t() | {String.t() | atom(), map()} | map() ) :: {:ok, CMDCOrchestrator.RunEvent.t()} | {:error, term()}
解析 RunStore 后端。
@spec list_events(backend(), String.t(), keyword()) :: {:ok, [CMDCOrchestrator.RunEvent.t()]} | {:error, term()}
@spec list_node_runs(backend(), String.t()) :: {:ok, [CMDCOrchestrator.NodeRun.t()]} | {:error, term()}
@spec list_runs( backend(), keyword() ) :: {:ok, [CMDCOrchestrator.Run.t()]} | {:error, term()}
@spec load_run(backend(), String.t()) :: {:ok, CMDCOrchestrator.Run.t()} | {:error, term()}
@spec save_run(backend(), CMDCOrchestrator.Run.t()) :: {:ok, CMDCOrchestrator.Run.t()} | {:error, term()}
@spec update_node_run( backend(), String.t(), String.t(), map() | (CMDCOrchestrator.NodeRun.t() -> CMDCOrchestrator.NodeRun.t()) ) :: {:ok, CMDCOrchestrator.NodeRun.t()} | {:error, term()}
@spec update_run( backend(), String.t(), map() | (CMDCOrchestrator.Run.t() -> CMDCOrchestrator.Run.t()) ) :: {:ok, CMDCOrchestrator.Run.t()} | {:error, term()}
@spec upsert_node_run(backend(), CMDCOrchestrator.NodeRun.t()) :: {:ok, CMDCOrchestrator.NodeRun.t()} | {:error, term()}