rest

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2015 License: Apache-2.0 Imports: 19 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

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

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

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

func NewUpgradeAwareProxyHandler

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

func (h *UpgradeAwareProxyHandler) RequestError() error

RequestError returns an error that occurred while handling request

func (*UpgradeAwareProxyHandler) ServeHTTP

ServeHTTP handles the proxy request

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

func NewWebHook

func NewWebHook(handler HookHandler, allowGet bool) *WebHook

func (*WebHook) Connect

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

func (*WebHook) ConnectMethods

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

func (*WebHook) New

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

func (*WebHook) NewConnectOptions

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

type WebHookHandler

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

func (*WebHookHandler) RequestError

func (h *WebHookHandler) RequestError() error

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