Documentation ¶
Overview ¶
Package apiserver manages kubernetes api extension apis
Index ¶
Constants ¶
const ( // ContentTypeHeader = "Content-Type" ContentTypeHeader = "Content-Type" // AcceptHeader = "Accept" AcceptHeader = "Accept" )
const ( // ListMaxCapacity is the maximum capacity for List in the gamerserver spec and status CRDs. ListMaxCapacity = int64(1000) )
Variables ¶
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 ¶
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 ¶
CRDHandler is a http handler, that gets passed the Namespace it's working on, and returns an error if a server error occurs