Documentation ¶
Index ¶
- type Resource
- type ResourceGetter
- func (r *ResourceGetter) Get() ([]Resource, error)
- func (r *ResourceGetter) WithCategories(categories ...string) *ResourceGetter
- func (r *ResourceGetter) WithGroups(groups ...string) *ResourceGetter
- func (r *ResourceGetter) WithScope(scope meta.RESTScopeName) *ResourceGetter
- func (r *ResourceGetter) WithVersions(versions ...string) *ResourceGetter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Resource ¶
type Resource struct { Group string Version string Kind string Resource string Object client.Object ObjectList client.ObjectList }
Resource represents Kubernetes API resource metadata, and associates the concepts of group, version, kind, resource, client.Object, and client.ObjectList.
type ResourceGetter ¶
type ResourceGetter struct {
// contains filtered or unexported fields
}
ResourceGetter allows retrieval of Kubernetes API resource (including CRDs) metadata with optional filters. The returned metadata associates the concepts of group, version, kind, resource, client.Object, and client.ObjectList. The implementation uses the kube-apiserver resource discovery API.
func NewResourceGetter ¶
func NewResourceGetter( scheme *runtime.Scheme, discoveryClient discovery.DiscoveryInterface, ) *ResourceGetter
NewResourceGetter returns a new ResourceGetter.
func (*ResourceGetter) Get ¶
func (r *ResourceGetter) Get() ([]Resource, error)
Get returns the resources filtered by the specified criteria.
func (*ResourceGetter) WithCategories ¶
func (r *ResourceGetter) WithCategories(categories ...string) *ResourceGetter
WithCategories filters for resources with the given categories. Reference: https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#categories.
func (*ResourceGetter) WithGroups ¶
func (r *ResourceGetter) WithGroups(groups ...string) *ResourceGetter
WithGroups filters for resources with the specified groups. Reference: https://kubernetes.io/docs/concepts/overview/kubernetes-api/#api-groups-and-versioning.
func (*ResourceGetter) WithScope ¶
func (r *ResourceGetter) WithScope(scope meta.RESTScopeName) *ResourceGetter
WithScope filters for resources with the specified scope (either namespace or cluster scoped).
func (*ResourceGetter) WithVersions ¶
func (r *ResourceGetter) WithVersions(versions ...string) *ResourceGetter
WithVersions filters for resources with the specified versions. Reference: https://kubernetes.io/docs/concepts/overview/kubernetes-api/#api-groups-and-versioning.