reactor

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OnPodEventFn

type OnPodEventFn func(pod *corev1.Pod) error

OnPodEventFn when a pod is modified this method handles the event.

type PodWatcher

type PodWatcher struct {
	// contains filtered or unexported fields
}

PodWatcher a simple function orchestrator based on watching a given pod and reacting upon the state modifications, should work as a helper to build business logic based on the build POD changes.

func NewPodWatcher

func NewPodWatcher(
	ctx context.Context,
	clientset kubernetes.Interface,
	listOpts metav1.ListOptions,
	ns string,
) (*PodWatcher, error)

NewPodWatcher instantiate PodWatcher event-loop.

func (*PodWatcher) Start

func (p *PodWatcher) Start() (*corev1.Pod, error)

Start runs the event loop based on a watch instantiated against informed pod. In case of errors the loop is interrupted.

func (*PodWatcher) Stop

func (p *PodWatcher) Stop()

Stop closes the stop channel, and stops the execution loop.

func (*PodWatcher) WithOnPodAddedFn

func (p *PodWatcher) WithOnPodAddedFn(fn OnPodEventFn) *PodWatcher

WithOnPodAddedFn sets the function executed when a pod is added.

func (*PodWatcher) WithOnPodDeletedFn

func (p *PodWatcher) WithOnPodDeletedFn(fn OnPodEventFn) *PodWatcher

WithOnPodDeletedFn sets the funcion executed when a pod is modified.

func (*PodWatcher) WithOnPodModifiedFn

func (p *PodWatcher) WithOnPodModifiedFn(fn OnPodEventFn) *PodWatcher

WithOnPodModifiedFn sets the funcion executed when a pod is modified.

func (*PodWatcher) WithSkipPodFn

func (p *PodWatcher) WithSkipPodFn(fn SkipPodFn) *PodWatcher

WithSkipPodFn sets the skip function instance.

type SkipPodFn

type SkipPodFn func(pod *corev1.Pod) bool

SkipPodFn a given pod instance is informed and expects a boolean as return. When true is returned this container state processing is skipped completely.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL