bonny v0.2.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

Returns the current resource version

Receives a plaintext formatted JSON response line from HTTPoison.AsyncChunk and parses into a map

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{
  config: K8s.Conf.t(),
  mod: 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()) :: nil

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

Link to this function get_resource_version(state)
get_resource_version(Bonny.Watcher.Impl.t()) ::
  {:ok, Bonny.Watcher.Impl.t()} | :error

Returns the current resource version

Link to this function new(controller)
Link to this function parse_chunk(line)
parse_chunk(binary()) :: map()

Receives a plaintext formatted JSON response line from HTTPoison.AsyncChunk and parses into a map

Link to this function watch_for_changes(state, watcher)
watch_for_changes(Bonny.Watcher.Impl.t(), pid()) :: nil

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

Streams HTTPoison response to Bonny.Watcher