Wardrik.Operations.Visible (wardrik v0.1.0-rc.1)

Copy Markdown

Limits operations over many agents to what the scope may see.

Only agents that the input's resource patterns cover, and the scope may act on, are shown. The same goes for their events and cursors.

Summary

Functions

Returns the ID of the agent whose log holds event.

Returns the IDs of saved or defined agents that input's patterns cover and scope may see.

Returns the log patterns that hold every agent input's patterns could cover.

Returns input's "resources" patterns, or ["*"].

Returns whether patterns cover the agent id and scope may see it.

Functions

agent_id(map)

@spec agent_id(map()) :: String.t()

Returns the ID of the agent whose log holds event.

agents(scope, input)

@spec agents(Wardrik.Scope.t(), map()) :: [String.t()]

Returns the IDs of saved or defined agents that input's patterns cover and scope may see.

logs(input)

@spec logs(map()) :: [String.t()]

Returns the log patterns that hold every agent input's patterns could cover.

patterns(input)

@spec patterns(map()) :: [String.t()]

Returns input's "resources" patterns, or ["*"].

visible?(scope, patterns, id)

@spec visible?(Wardrik.Scope.t(), [String.t()], String.t()) :: boolean()

Returns whether patterns cover the agent id and scope may see it.