type apisHandler … func discoveryGroup(enabledVersions sets.String) metav1.APIGroup { … } func (r *apisHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) { … } // convertToDiscoveryAPIGroup takes apiservices in a single group and returns a discovery compatible object. // if none of the services are available, it will return nil. func convertToDiscoveryAPIGroup(apiServices []*apiregistrationv1api.APIService) *metav1.APIGroup { … } type apiGroupHandler … func (r *apiGroupHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) { … }