rest

package
v1.12.1-lite6 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2018 License: Apache-2.0, Apache-2.0 Imports: 11 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 GenericHttpResponseChecker

type GenericHttpResponseChecker struct {
	QualifiedResource schema.GroupResource
	Name              string
}

A generic http response checker to transform the error.

func NewGenericHttpResponseChecker

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

func (GenericHttpResponseChecker) Check

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

type HttpResponseChecker

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

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

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

func (*LocationStreamer) DeepCopyObject

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

func (*LocationStreamer) GetObjectKind

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

func (*LocationStreamer) InputStream

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.

Jump to

Keyboard shortcuts

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