bonny v0.3.3 Bonny.Watcher.Impl

Implementation logic for Bonny.Watcher

Link to this section Summary

Functions

Dispatches an ADDED, MODIFIED, and DELETED events to an controller

Gets the resource version from the state, or fetches it from Kubernetes API if not present

Initialize a Bonny.Watcher state

Watches a CRD resource for ADDED, MODIFIED, and DELETED events from the Kubernetes API.

Link to this section Types

Link to this type

t()
t() :: %Bonny.Watcher.Impl{
  buffer: Bonny.Watcher.ResponseBuffer.t(),
  controller: atom(),
  resource_version: String.t() | nil,
  spec: Bonny.CRD.t()
}

Link to this section Functions

Link to this function

dispatch(map, controller)
dispatch(map(), atom()) :: no_return()

Dispatches an ADDED, MODIFIED, and DELETED events to an controller

Link to this function

extract_rv(map)
extract_rv(map() | binary()) :: binary() | {:gone, binary()}

Link to this function

get_resource_version(state)
get_resource_version(Bonny.Watcher.Impl.t()) :: binary()

Gets the resource version from the state, or fetches it from Kubernetes API if not present

Initialize a Bonny.Watcher state

Link to this function

process_line(line, current_rv, state)

Link to this function

process_lines(state, lines)

Link to this function

watch_for_changes(state, watcher)
watch_for_changes(Bonny.Watcher.Impl.t(), pid()) :: no_return()

Watches a CRD resource for ADDED, MODIFIED, and DELETED events from the Kubernetes API.

Streams HTTPoison response to Bonny.Watcher