Wardrik.Events (wardrik_protocol v0.1.0-rc.1)

Copy Markdown

Operations on the events of every agent the scope can see.

{:ok, cursor} = Wardrik.Events.head(scope)
{:ok, stream} = Wardrik.Events.stream_list(scope, after: cursor)

Summary

Functions

Read where the logs the patterns cover stand

Read the events of the agents the patterns cover

Read the events of the agents the patterns cover, then follow new events as they arrive. Returns {:ok, stream} of {%Wardrik.Event{}, cursor} pairs.

Functions

head(scope, input \\ [])

@spec head(Wardrik.Scope.t(), term()) :: term() | :ok | {:error, Wardrik.Error.t()}

Read where the logs the patterns cover stand

GET /v1/events/head

list(scope, input \\ [])

@spec list(Wardrik.Scope.t(), term()) :: term() | :ok | {:error, Wardrik.Error.t()}

Read the events of the agents the patterns cover

A page reads after the cursor, from the start without one. A stream reads after the cursor, from what's written next without one. Where a log was trimmed past the cursor, a wardrik.events.dropped says so, and the log is read on from the oldest event it holds.

GET /v1/events

stream_list(scope, input \\ [])

@spec stream_list(Wardrik.Scope.t(), term()) ::
  {:ok, Enumerable.t()} | :ok | {:error, Wardrik.Error.t()}

Read the events of the agents the patterns cover, then follow new events as they arrive. Returns {:ok, stream} of {%Wardrik.Event{}, cursor} pairs.

A page reads after the cursor, from the start without one. A stream reads after the cursor, from what's written next without one. Where a log was trimmed past the cursor, a wardrik.events.dropped says so, and the log is read on from the oldest event it holds.

GET /v1/events