Documentation ¶
Overview ¶
poller package contains the implementation of status poller for monitoring a set of resources on the remote server and posting their updates in a channel
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CustomStatusCheckers ¶
type CustomStatusCheckers map[schema.GroupKind]StatusCheckerFunc
CustomStatusCheckers contains a mapping of GroupKind to StatusCheckerFunc for adding custom status parsing for custom resources that don't follow the basic encoded ones.
type FakePoller ¶
type FakePoller struct{}
FakePoller is used to test correct behaviour of code that will work with events sent from a StatusPoller
func (*FakePoller) Start ¶
func (p *FakePoller) Start(ctx context.Context, objs []*unstructured.Unstructured) <-chan event.Event
Start implement StatusPoller, but it will use the objs to generate the relevant statuses to return to the channel
type StatusCheckerFunc ¶
type StatusCheckerFunc func(*unstructured.Unstructured) (*Result, error)
StatusCheckerFunc is a function that return a status Result or error for the given uUnstructured object.
type StatusPoller ¶
type StatusPoller interface { // Start will start polling the remote api-server for getting updates to the passed resources Start(context.Context, []*unstructured.Unstructured) <-chan event.Event }
func NewDefaultStatusPoller ¶
func NewDefaultStatusPoller(client dynamic.Interface, mapper meta.RESTMapper, statusCheckers CustomStatusCheckers) StatusPoller
NewDefaultStatusPoller return a default implementation of StatusPoller that will connect to the remote api-server and elaborate the current status of the requested resources