func NewDiscoveryCategoryExpander(client discovery.DiscoveryInterface) CategoryExpander {
	if client == nil {
		panic("Please provide discovery client to shortcut expander")
	}
	return discoveryCategoryExpander{discoveryClient: client}
}
NewDiscoveryCategoryExpander returns a category expander that makes use of the "categories" fields from
the API, found through the discovery client. In case of any error or no category found (which likely
means we're at a cluster prior to categories support, fallback to the expander provided.
package restmapper
import (
	"k8s.io/apimachinery/pkg/runtime/schema"
	"k8s.io/client-go/discovery"
)
type CategoryExpander interface {
	Expand(category string) ([]schema.GroupResource, bool)
}
type SimpleCategoryExpander struct {
	Expansions map[string][]schema.GroupResource
}
func (e SimpleCategoryExpander) Expand(category string) ([]schema.GroupResource, bool) {
	ret, ok := e.Expansions[category]
	return ret, ok
}
type discoveryCategoryExpander struct {
	discoveryClient discovery.DiscoveryInterface
}