rest

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HookHandler

type HookHandler interface {
	ServeHTTP(w http.ResponseWriter, r *http.Request, ctx api.Context, name, subpath string) error
}

HookHandler is a Kubernetes API compatible webhook that is able to get access to the raw request and response. Used when adapting existing webhook code to the Kubernetes patterns.

type WebHook

type WebHook struct {
	// contains filtered or unexported fields
}

WebHook provides a reusable rest.Storage implementation for linking a generic WebHook handler into the Kube API pattern. It is intended to be used with GET or POST against a resource's named path, possibly as a subresource. The handler has access to the extracted information from the Kube apiserver including the context, the name, and the subpath.

func NewHTTPWebHook

func NewHTTPWebHook(handler http.Handler, allowGet bool) *WebHook

NewHTTPWebHook creates an adapter that implements rest.Connector for the given http.Handler.

func NewWebHook

func NewWebHook(handler HookHandler, allowGet bool) *WebHook

NewWebHook creates an adapter that implements rest.Connector for the given HookHandler.

func (*WebHook) Connect

func (h *WebHook) Connect(ctx api.Context, name string, options runtime.Object, responder rest.Responder) (http.Handler, error)

Connect responds to connections with a ConnectHandler

func (*WebHook) ConnectMethods

func (h *WebHook) ConnectMethods() []string

ConnectMethods returns the supported web hook types.

func (*WebHook) New

func (h *WebHook) New() runtime.Object

New() responds with the status object.

func (*WebHook) NewConnectOptions

func (h *WebHook) NewConnectOptions() (runtime.Object, bool, string)

NewConnectionOptions identifies the options that should be passed to this hook

type WebHookHandler

type WebHookHandler struct {
	// contains filtered or unexported fields
}

WebHookHandler responds to web hook requests from the master.

func (*WebHookHandler) ServeHTTP

func (h *WebHookHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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