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 ¶
func (h *UpgradeAwareProxyHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)
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 NewWebHook ¶
func NewWebHook(handler HookHandler, allowGet bool) *WebHook
func (*WebHook) ConnectMethods ¶
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)