Backplane.AgentRuntime.Resource behaviour (backplane_agent_runtime v1.6.0)

Copy Markdown

Scoped resource operations with revision-safe writes and bounded output.

The adapter owns real confinement. This module validates references, expected revisions, and output bounds without pretending Path.expand is a sandbox.

Summary

Types

t()

@type t() :: map()

Callbacks

file_edit(map, map, map, keyword)

@callback file_edit(map(), map(), map(), keyword()) ::
  {:ok, map()} | {:error, Backplane.AgentRuntime.Error.t()}

glob(map, map, binary, keyword)

@callback glob(map(), map(), binary(), keyword()) ::
  {:ok, map()} | {:error, Backplane.AgentRuntime.Error.t()}

grep(map, map, keyword)

@callback grep(map(), map(), keyword()) ::
  {:ok, map()} | {:error, Backplane.AgentRuntime.Error.t()}

list_dir(map, map, keyword)

@callback list_dir(map(), map(), keyword()) ::
  {:ok, map()} | {:error, Backplane.AgentRuntime.Error.t()}

read(map, map, keyword)

@callback read(map(), map(), keyword()) ::
  {:ok, map()} | {:error, Backplane.AgentRuntime.Error.t()}

write(map, map, map, keyword)

@callback write(map(), map(), map(), keyword()) ::
  {:ok, map()} | {:error, Backplane.AgentRuntime.Error.t()}

Functions

file_edit(resource, reference, content, opts \\ [])

@spec file_edit(t(), map(), map(), keyword()) ::
  {:ok, map()} | {:error, Backplane.AgentRuntime.Error.t()}

glob(resource, reference, pattern, opts \\ [])

@spec glob(t(), map(), binary(), keyword()) ::
  {:ok, map()} | {:error, Backplane.AgentRuntime.Error.t()}

grep(resource, reference, opts \\ [])

@spec grep(t(), map(), keyword()) ::
  {:ok, map()} | {:error, Backplane.AgentRuntime.Error.t()}

list_dir(resource, reference, opts \\ [])

@spec list_dir(t(), map(), keyword()) ::
  {:ok, map()} | {:error, Backplane.AgentRuntime.Error.t()}

new(namespace)

@spec new(map()) :: {:ok, t()} | {:error, Backplane.AgentRuntime.Error.t()}

read(resource, reference, opts \\ [])

@spec read(t(), map(), keyword()) ::
  {:ok, map()} | {:error, Backplane.AgentRuntime.Error.t()}

write(resource, reference, content, opts \\ [])

@spec write(t(), map(), map(), keyword()) ::
  {:ok, map()} | {:error, Backplane.AgentRuntime.Error.t()}