webhook

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2018 License: Apache-2.0, Apache-2.0 Imports: 11 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