v1.38.0 Latest Latest

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 16 Imported by: 0



Package apiserver manages kubernetes api extension apis



View Source
const (
	// ContentTypeHeader = "Content-Type"
	ContentTypeHeader = "Content-Type"
	// AcceptHeader = "Accept"
	AcceptHeader = "Accept"
View Source
const (
	// ListMaxCapacity is the maximum capacity for List in the gamerserver spec and status CRDs.
	ListMaxCapacity = int64(1000)


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)


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


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/v1 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