watch

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2021 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleIntegrationEvents

func HandleIntegrationEvents(ctx context.Context, integration *v1.Integration,
	handler func(event *corev1.Event) bool) error

HandleIntegrationEvents watches all events related to the given integration.

    watch.HandleIntegrationEvents(o.Context, integration, func(event *corev1.Event) bool {
		 println(event.Message)
		 return true
	   })

This function blocks until the handler function returns true or either the events channel or the context is closed.

func HandleIntegrationPlatformEvents

func HandleIntegrationPlatformEvents(ctx context.Context, p *v1.IntegrationPlatform,
	handler func(event *corev1.Event) bool) error

HandleIntegrationPlatformEvents watches all events related to the given integration platform.

    watch.HandleIntegrationPlatformEvents(o.Context, platform, func(event *corev1.Event) bool {
		 println(event.Message)
		 return true
	   })

This function blocks until the handler function returns true or either the events channel or the context is closed.

func HandleIntegrationStateChanges

func HandleIntegrationStateChanges(ctx context.Context, integration *v1.Integration,
	handler func(integration *v1.Integration) bool) (*v1.IntegrationPhase, error)

HandleIntegrationStateChanges watches a integration resource and invoke the given handler when its status changes.

    err := watch.HandleIntegrationStateChanges(ctx, integration, func(i *v1.Integration) bool {
        if i.Status.Phase == v1.IntegrationPhaseRunning {
			    return false
		    }

		    return true
	    })

This function blocks until the handler function returns true or either the events channel or the context is closed.

func HandlePlatformStateChanges

func HandlePlatformStateChanges(ctx context.Context, platform *v1.IntegrationPlatform, handler func(platform *v1.IntegrationPlatform) bool) error

HandlePlatformStateChanges watches a platform resource and invoke the given handler when its status changes.

    err := watch.HandlePlatformStateChanges(ctx, platform, func(i *v1.IntegrationPlatform) bool {
        if i.Status.Phase == v1.IntegrationPlatformPhaseReady {
			    return false
		    }

		    return true
	    })

This function blocks until the handler function returns true or either the events channel or the context is closed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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