popeye: github.com/derailed/popeye/internal Index | Files | Directories

package internal

import "github.com/derailed/popeye/internal"


Package Files

alias.go context.go keys.go stringset.go


const All = "all"

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


var AllKeys = StringSet{All: Blank}

AllKeys indicates all keys are present.

var Blank = Empty{}

Blank represents an empty value.

func MustExtractFQN Uses

func MustExtractFQN(ctx context.Context) string

MustExtractFQN extract fqn from context or die.

func MustExtractSectionGVR Uses

func MustExtractSectionGVR(ctx context.Context) string

MustExtractSectionGVR extract section gvr from context or die.

func WithFQN Uses

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

WithFQN adds a fqn to the context.

func WithGroup Uses

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

WithGroup adds a group to the context.

type Aliases Uses

type Aliases struct {
    // contains filtered or unexported fields

Aliases represents a collection of resource aliases.

func NewAliases Uses

func NewAliases() *Aliases

NewAliases returns a new instance.

func (*Aliases) Exclude Uses

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

Exclude checks if section should be excluded from the report.

func (*Aliases) Init Uses

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

Init loads the aliases glossary.

func (*Aliases) Singular Uses

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

Singular returns a singular resource name.

func (*Aliases) TitleFor Uses

func (a *Aliases) TitleFor(s string, plural bool) string

TitleFor produces a section title from an alias.

func (*Aliases) ToResources Uses

func (a *Aliases) ToResources(nn []string) []string

ToResources converts aliases to resource names.

type ContextKey Uses

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"

A collection of context keys.

type Empty Uses

type Empty struct{}

Empty denotes an empty value.

type ResourceMetas Uses

type ResourceMetas map[client.GVR]metav1.APIResource

ResourceMetas represents a collection of resource metadata.

type RunInfo Uses

type RunInfo struct {
    Section    string
    SectionGVR client.GVR
    FQN        string
    Group      string
    GroupGVR   client.GVR

RunInfo describes a sanitizer run.

func MustExtractRunInfo Uses

func MustExtractRunInfo(ctx context.Context) RunInfo

MustExtractRunInfo extracts runinfo from context or die.

type StringSet Uses

type StringSet map[string]Empty

StringSet represents a set of strings.

func (StringSet) Add Uses

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

Add a collection of elements to the set.

func (StringSet) Clone Uses

func (ss StringSet) Clone() StringSet

Clone returns a new copy.

func (StringSet) Diff Uses

func (ss StringSet) Diff(set StringSet) StringSet

Diff computes B-A.

func (StringSet) Has Uses

func (ss StringSet) Has(s string) bool

Has checks if an item is in the set.



Package internal imports 7 packages (graph) and is imported by 7 packages. Updated 2020-07-07. Refresh now. Tools for package owners.