Documentation ¶
Index ¶
- func NewDiscoveryCategoryExpander(fallbackExpander CategoryExpander, client discovery.DiscoveryInterface) (discoveryCategoryExpander, error)
- func NewDiscoveryFilteredExpander(delegate CategoryExpander, client discovery.DiscoveryInterface) (discoveryFilteredExpander, error)
- type CategoryExpander
- type SimpleCategoryExpander
- type UnionCategoryExpander
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDiscoveryCategoryExpander ¶
func NewDiscoveryCategoryExpander(fallbackExpander CategoryExpander, client discovery.DiscoveryInterface) (discoveryCategoryExpander, error)
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.
func NewDiscoveryFilteredExpander ¶
func NewDiscoveryFilteredExpander(delegate CategoryExpander, client discovery.DiscoveryInterface) (discoveryFilteredExpander, error)
NewDiscoveryFilteredExpander returns a category expander that filters the returned groupresources by what the server has available
Types ¶
type CategoryExpander ¶
type CategoryExpander interface {
Expand(category string) ([]schema.GroupResource, bool)
}
CategoryExpander maps category strings to GroupResouces. Categories are classification or 'tag' of a group of resources.
var LegacyCategoryExpander CategoryExpander = SimpleCategoryExpander{ Expansions: map[string][]schema.GroupResource{ "all": legacyUserResources, }, }
LegacyCategoryExpander is the old hardcoded expansion
type SimpleCategoryExpander ¶
type SimpleCategoryExpander struct {
Expansions map[string][]schema.GroupResource
}
SimpleCategoryExpander implements CategoryExpander interface using a static mapping of categories to GroupResource mapping.
func (SimpleCategoryExpander) Expand ¶
func (e SimpleCategoryExpander) Expand(category string) ([]schema.GroupResource, bool)
type UnionCategoryExpander ¶
type UnionCategoryExpander []CategoryExpander
UnionCategoryExpander implements CategoryExpander interface. It maps given category string to union of expansions returned by all the CategoryExpanders in the list.
func (UnionCategoryExpander) Expand ¶
func (u UnionCategoryExpander) Expand(category string) ([]schema.GroupResource, bool)