Documentation
¶
Index ¶
- Constants
- Variables
- func MustExtractFQN(ctx context.Context) string
- func MustExtractSectionGVR(ctx context.Context) string
- func WithFQN(ctx context.Context, fqn string) context.Context
- func WithGroup(ctx context.Context, gvr client.GVR, grp string) context.Context
- type Aliases
- type ContextKey
- type Empty
- type ResourceMetas
- type RunInfo
- type StringSet
Constants ¶
const All = "all"
All indicates all data keys are being used when referencing a cm or secret.
Variables ¶
var AllKeys = StringSet{All: Blank}
AllKeys indicates all keys are present.
var Blank = Empty{}
Blank represents an empty value.
Functions ¶
func MustExtractFQN ¶
func MustExtractFQN(ctx context.Context) string
MustExtractFQN extract fqn from context or die.
func MustExtractSectionGVR ¶ added in v0.8.0
func MustExtractSectionGVR(ctx context.Context) string
MustExtractSectionGVR extract section gvr from context or die.
Types ¶
type Aliases ¶
type Aliases struct {
// contains filtered or unexported fields
}
Aliases represents a collection of resource aliases.
func (*Aliases) Exclude ¶ added in v0.8.0
func (a *Aliases) Exclude(gvr client.GVR, sections []string) bool
Exclude checks if section should be excluded from the report.
func (*Aliases) Init ¶ added in v0.8.0
func (a *Aliases) Init(f types.Factory, gvrs []string) error
Init loads the aliases glossary.
func (*Aliases) Singular ¶ added in v0.8.0
func (a *Aliases) Singular(gvr client.GVR) string
Singular returns a singular resource name.
func (*Aliases) TitleFor ¶ added in v0.8.0
func (a *Aliases) TitleFor(s string, plural bool) string
TitleFor produces a section title from an alias.
func (*Aliases) ToResources ¶
func (a *Aliases) ToResources(nn []string) []string
ToResources converts aliases to resource names.
type ContextKey ¶ added in v0.8.0
type ContextKey string
ContextKey represents context key.
const (
KeyFactory ContextKey = "factory"
KeyLabels ContextKey = "labels"
KeyFields ContextKey = "fields"
KeyOverAllocs ContextKey = "overAllocs"
KeyRunInfo ContextKey = "runInfo"
KeyConfig ContextKey = "config"
)
A collection of context keys.
type ResourceMetas ¶ added in v0.8.0
type ResourceMetas map[client.GVR]metav1.APIResource
ResourceMetas represents a collection of resource metadata.
type RunInfo ¶
type RunInfo struct {
Section string
SectionGVR client.GVR
FQN string
Group string
GroupGVR client.GVR
}
RunInfo describes a sanitizer run.
func MustExtractRunInfo ¶
func MustExtractRunInfo(ctx context.Context) RunInfo
MustExtractRunInfo extracts runinfo from context or die.