internal

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 MustExtractSection

func MustExtractSection(ctx context.Context) string

MustExtractSection extract section 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, grp string) context.Context

WithGroup adds a group to the context.

Types

type Alias

type Alias struct {
	ShortNames StringSet
	Plural     string
}

Alias represents a resource alias.

type Aliases

type Aliases struct {
	// contains filtered or unexported fields
}

Aliases represents a collection of aliases.

func NewAliases

func NewAliases() *Aliases

NewAliases returns a new alias glossary.

func (Aliases) FromAlias

func (a Aliases) FromAlias(res string) string

FromAlias returns the resource name from an alias.

func (Aliases) Pluralize

func (a Aliases) Pluralize(res string) string

Pluralize returns a plural form.

func (*Aliases) ToResources

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

ToResources converts aliases to resource names.

type Empty

type Empty struct{}

Empty denotes an empty value.

type PopeyeKey

type PopeyeKey string

PopeyeKey namespaces popeye context keys.

const (
	// KeyRun stores run information.
	KeyRun PopeyeKey = "runinfo"
)

type RunInfo

type RunInfo struct {
	Section, FQN, Group string
}

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) 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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL