Documentation
¶
Index ¶
- type OnPodEventFn
- type PodWatcher
- func (p *PodWatcher) Start() (*corev1.Pod, error)
- func (p *PodWatcher) Stop()
- func (p *PodWatcher) WithOnPodAddedFn(fn OnPodEventFn) *PodWatcher
- func (p *PodWatcher) WithOnPodDeletedFn(fn OnPodEventFn) *PodWatcher
- func (p *PodWatcher) WithOnPodModifiedFn(fn OnPodEventFn) *PodWatcher
- func (p *PodWatcher) WithSkipPodFn(fn SkipPodFn) *PodWatcher
- type SkipPodFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OnPodEventFn ¶
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.