apiserver: k8s.io/apiserver/pkg/registry/generic/rest Index | Files

package rest

import "k8s.io/apiserver/pkg/registry/generic/rest"

Package rest has generic implementations of resources used for REST responses


Package Files

doc.go response_checker.go streamer.go

func PreventRedirects Uses

func PreventRedirects(_ *http.Request, _ []*http.Request) error

PreventRedirects is a redirect checker that prevents the client from following a redirect.

type GenericHttpResponseChecker Uses

type GenericHttpResponseChecker struct {
    QualifiedResource schema.GroupResource
    Name              string

A generic http response checker to transform the error.

func NewGenericHttpResponseChecker Uses

func NewGenericHttpResponseChecker(qualifiedResource schema.GroupResource, name string) GenericHttpResponseChecker

func (GenericHttpResponseChecker) Check Uses

func (checker GenericHttpResponseChecker) Check(resp *http.Response) error

type HttpResponseChecker Uses

type HttpResponseChecker interface {
    Check(resp *http.Response) error

Check the http error status from a location URL. And convert an error into a structured API object. Finally ensure we close the body before returning the error

type LocationStreamer Uses

type LocationStreamer struct {
    Location        *url.URL
    Transport       http.RoundTripper
    ContentType     string
    Flush           bool
    ResponseChecker HttpResponseChecker
    RedirectChecker func(req *http.Request, via []*http.Request) error

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

func (*LocationStreamer) DeepCopyObject Uses

func (obj *LocationStreamer) DeepCopyObject() runtime.Object

func (*LocationStreamer) GetObjectKind Uses

func (obj *LocationStreamer) GetObjectKind() schema.ObjectKind

func (*LocationStreamer) InputStream Uses

func (s *LocationStreamer) InputStream(ctx context.Context, 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.

Package rest imports 12 packages (graph) and is imported by 36 packages. Updated 2019-09-19. Refresh now. Tools for package owners.