webhook

package
v0.0.0-...-9425fe8 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package webhook implements a generic HTTP webhook plugin.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithExponentialBackoff

func WithExponentialBackoff(initialBackoff time.Duration, webhookFn func() error) error

WithExponentialBackoff will retry webhookFn() up to 5 times with exponentially increasing backoff when it returns an error for which apierrors.SuggestsClientDelay() or apierrors.IsInternalError() returns true.

Types

type GenericWebhook

type GenericWebhook struct {
	RestClient *rest.RESTClient
	// contains filtered or unexported fields
}

func NewGenericWebhook

func NewGenericWebhook(registry *registered.APIRegistrationManager, codecFactory serializer.CodecFactory, kubeConfigFile string, groupVersions []schema.GroupVersion, initialBackoff time.Duration) (*GenericWebhook, error)

NewGenericWebhook creates a new GenericWebhook from the provided kubeconfig file.

func (*GenericWebhook) WithExponentialBackoff

func (g *GenericWebhook) WithExponentialBackoff(webhookFn func() rest.Result) rest.Result

WithExponentialBackoff will retry webhookFn() up to 5 times with exponentially increasing backoff when it returns an error for which apierrors.SuggestsClientDelay() or apierrors.IsInternalError() returns true.

Jump to

Keyboard shortcuts

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