rest

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2015 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package rest has generic implementations of resources used for REST responses

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HookHandler added in v0.5.1

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 LocationStreamer

type LocationStreamer struct {
	Location    *url.URL
	Transport   http.RoundTripper
	ContentType string
	Flush       bool
}

LocationStreamer is a resource that streams the contents of a particular location URL

func (*LocationStreamer) InputStream

func (s *LocationStreamer) InputStream(apiVersion, acceptHeader string) (stream io.ReadCloser, flush bool, contentType string, err error)

InputStream returns a stream with the contents of the URL location. If no location is provided, a null stream is returned.

func (*LocationStreamer) IsAnAPIObject

func (*LocationStreamer) IsAnAPIObject()

IsAnAPIObject marks this object as a runtime.Object

type UpgradeAwareProxyHandler added in v0.5.1

type UpgradeAwareProxyHandler struct {
	UpgradeRequired bool
	Location        *url.URL
	Transport       http.RoundTripper
	FlushInterval   time.Duration
	// contains filtered or unexported fields
}

UpgradeAwareProxyHandler is a handler for proxy requests that may require an upgrade

func NewUpgradeAwareProxyHandler added in v0.5.1

func NewUpgradeAwareProxyHandler(location *url.URL, transport http.RoundTripper, upgradeRequired bool) *UpgradeAwareProxyHandler

NewUpgradeAwareProxyHandler creates a new proxy handler with a default flush interval

func (*UpgradeAwareProxyHandler) RequestError added in v0.5.1

func (h *UpgradeAwareProxyHandler) RequestError() error

RequestError returns an error that occurred while handling request

func (*UpgradeAwareProxyHandler) ServeHTTP added in v0.5.1

ServeHTTP handles the proxy request

type WebHook added in v0.5.1

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 added in v0.5.1

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

func NewWebHook added in v0.5.1

func NewWebHook(handler HookHandler, allowGet bool) *WebHook

func (*WebHook) Connect added in v0.5.1

func (h *WebHook) Connect(ctx api.Context, name string, options runtime.Object) (rest.ConnectHandler, error)

func (*WebHook) ConnectMethods added in v0.5.1

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

func (*WebHook) New added in v0.5.1

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

func (*WebHook) NewConnectOptions added in v0.5.1

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

type WebHookHandler added in v0.5.1

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

func (*WebHookHandler) RequestError added in v0.5.1

func (h *WebHookHandler) RequestError() error

func (*WebHookHandler) ServeHTTP added in v0.5.1

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