handler

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2019 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddFunc

type AddFunc func(context.Context, runtime.Object) error

AddFunc knows how to handle resource adds.

type DeleteFunc

type DeleteFunc func(context.Context, string) error

DeleteFunc knows how to handle resource deletes.

type Handler

type Handler interface {
	Add(context.Context, runtime.Object) error
	Delete(context.Context, string) error
}

Handler knows how to handle the received resources from a kubernetes cluster.

type HandlerFunc

type HandlerFunc struct {
	AddFunc    AddFunc
	DeleteFunc DeleteFunc
}

HandlerFunc is a handler that is created from functions that the Handler interface requires.

func (*HandlerFunc) Add

func (h *HandlerFunc) Add(ctx context.Context, obj runtime.Object) error

Add satisfies Handler interface.

func (*HandlerFunc) Delete

func (h *HandlerFunc) Delete(ctx context.Context, s string) error

Delete satisfies Handler interface.

type Logger

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

Logger will log the handling events. This handler can be sued to test that a controller receives resource events..

func NewLogger

func NewLogger(logger log.Logger) *Logger

NewLogger returns a new logger.

func (*Logger) Add

func (l *Logger) Add(_ context.Context, obj runtime.Object) error

Add satisfies Handler interface.

func (*Logger) Delete

func (l *Logger) Delete(_ context.Context, objKey string) error

Delete satisfies Handler interface.

Jump to

Keyboard shortcuts

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