Documentation
¶
Overview ¶
Package resource is the noun half of the patchy grammar: it maps what a user types (finding, findings, fnd) onto the kind, list type and API resource name the command then works with.
The aliases are not invented here. Each one is the shortName the CRD already declares (api/v1alpha1, +kubebuilder:resource:shortName), so `patchy get fnd` and `kubectl get fnd` always mean the same thing — a user who learns one spelling has learned both.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Kinds = []Kind{ { Singular: "finding", Plural: "findings", Aliases: []string{"fnd"}, New: func() client.Object { return &v1alpha1.Finding{} }, NewList: func() client.ObjectList { return &v1alpha1.FindingList{} }, }, { Singular: "investigation", Plural: "investigations", Aliases: []string{"inv"}, New: func() client.Object { return &v1alpha1.Investigation{} }, NewList: func() client.ObjectList { return &v1alpha1.InvestigationList{} }, }, { Singular: "remediation", Plural: "remediations", Aliases: []string{"rem"}, New: func() client.Object { return &v1alpha1.Remediation{} }, NewList: func() client.ObjectList { return &v1alpha1.RemediationList{} }, }, { Singular: "findingrollup", Plural: "findingrollups", Aliases: []string{"fr", "rollup", "rollups"}, New: func() client.Object { return &v1alpha1.FindingRollup{} }, NewList: func() client.ObjectList { return &v1alpha1.FindingRollupList{} }, }, { Singular: "repository", Plural: "repositories", Aliases: []string{"repo", "repos"}, New: func() client.Object { return &v1alpha1.Repository{} }, NewList: func() client.ObjectList { return &v1alpha1.RepositoryList{} }, }, { Singular: "integration", Plural: "integrations", New: func() client.Object { return &v1alpha1.Integration{} }, NewList: func() client.ObjectList { return &v1alpha1.IntegrationList{} }, }, { Singular: "forge", Plural: "forges", New: func() client.Object { return &v1alpha1.Forge{} }, NewList: func() client.ObjectList { return &v1alpha1.ForgeList{} }, }, }
Kinds are the nouns, in the order `patchy api-resources`-style help lists them: the pipeline state machine first, then its configuration.
Functions ¶
Types ¶
type Kind ¶
type Kind struct {
// Singular is the canonical spelling, used in messages ("finding fnd-1").
Singular string
// Plural is the API resource name, and what the URL path uses.
Plural string
// Aliases are the other accepted spellings: the plural, plus the CRD's
// declared shortName.
Aliases []string
// New returns an empty object of the kind.
New func() client.Object
// NewList returns an empty list of the kind.
NewList func() client.ObjectList
}
Kind describes one noun the CLI understands.