apiserver

package
v1.6.0-rc Latest Latest
Warning

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

Go to latest
Published: May 20, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package apiserver manages kubernetes api extension apis

Index

Constants

View Source
const (
	// ContentTypeHeader = "Content-Type"
	ContentTypeHeader = "Content-Type"
	// AcceptHeader = "Accept"
	AcceptHeader = "Accept"
)

Variables

View Source
var (

	// Scheme scheme for unversioned types - such as APIResourceList, and Status
	Scheme = k8sruntime.NewScheme()
	// Codecs for unversioned types - such as APIResourceList, and Status
	Codecs = serializer.NewCodecFactory(Scheme)
)

Functions

func AcceptedSerializer

func AcceptedSerializer(r *http.Request, codecs serializer.CodecFactory) (k8sruntime.SerializerInfo, error)

AcceptedSerializer takes the request, and returns a serialiser (if it exists) for the given codec factory and for the Accepted media types. If not found, returns error

Types

type APIServer

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

APIServer is a lightweight library for registering, and providing handlers for Kubernetes APIServer extensions.

func NewAPIServer

func NewAPIServer(mux *http.ServeMux) *APIServer

NewAPIServer returns a new API Server from the given Mux. creates a empty Swagger definition and sets up the endpoint.

func (*APIServer) AddAPIResource

func (as *APIServer) AddAPIResource(groupVersion string, resource metav1.APIResource, handler CRDHandler)

AddAPIResource stores the APIResource under the given groupVersion string, and returns it in the appropriate place for the K8s discovery service e.g. http://localhost:8001/apis/scheduling.k8s.io/v1beta1 as well as registering a CRDHandler that all http requests for the given APIResource are routed to

type CRDHandler

type CRDHandler func(http.ResponseWriter, *http.Request, string) error

CRDHandler is a http handler, that gets passed the Namespace it's working on, and returns an error if a server error occurs

Jump to

Keyboard shortcuts

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