webhook

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2017 License: Apache-2.0 Imports: 12 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 added in v1.5.0

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 *restclient.RESTClient
	// contains filtered or unexported fields
}

func NewGenericWebhook

func NewGenericWebhook(kubeConfigFile string, groupVersions []unversioned.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() restclient.Result) restclient.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