Version: v0.9.7 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2021 License: Apache-2.0 Imports: 7 Imported by: 0




View Source
const All = "all"

All indicates all data keys are being used when referencing a cm or secret.


View Source
var AllKeys = StringSet{All: Blank}

AllKeys indicates all keys are present.

View Source
var Blank = Empty{}

Blank represents an empty value.


func MustExtractFQN

func MustExtractFQN(ctx context.Context) string

MustExtractFQN extract fqn from context or die.

func MustExtractSectionGVR

func MustExtractSectionGVR(ctx context.Context) string

MustExtractSectionGVR extract section gvr from context or die.

func WithFQN

func WithFQN(ctx context.Context, fqn string) context.Context

WithFQN adds a fqn to the context.

func WithGroup

func WithGroup(ctx context.Context, gvr client.GVR, grp string) context.Context

WithGroup adds a group to the context.


type Aliases

type Aliases struct {
	// contains filtered or unexported fields

Aliases represents a collection of resource aliases.

func NewAliases

func NewAliases() *Aliases

NewAliases returns a new instance.

func (*Aliases) Exclude

func (a *Aliases) Exclude(gvr client.GVR, sections []string) bool

Exclude checks if section should be excluded from the report.

func (*Aliases) Init

func (a *Aliases) Init(f types.Factory, gvrs []string) error

Init loads the aliases glossary.

func (*Aliases) Singular

func (a *Aliases) Singular(gvr client.GVR) string

Singular returns a singular resource name.

func (*Aliases) TitleFor

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

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"
	KeyNamespace  ContextKey = "namespace"
	KeyVersion    ContextKey = "version"

A collection of context keys.

type Empty

type Empty struct{}

Empty denotes an empty value.

type ResourceMetas

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.

type StringSet

type StringSet map[string]Empty

StringSet represents a set of strings.

func (StringSet) Add

func (ss StringSet) Add(strs ...string)

Add a collection of elements to the set.

func (StringSet) AddAll

func (ss StringSet) AddAll(s StringSet)

AddAll merges two sets.

func (StringSet) Clone

func (ss StringSet) Clone() StringSet

Clone returns a new copy.

func (StringSet) Diff

func (ss StringSet) Diff(set StringSet) StringSet

Diff computes B-A.

func (StringSet) Has

func (ss StringSet) Has(s string) bool

Has checks if an item is in the set.


Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto