completion

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: MIT Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	CompletePluralResource            = 1
	CompleteSingularResource          = 2
	CompleteAttributeKey              = 4
	CompleteAttributeValue            = 8
	CompleteQueryParamKey             = 16
	CompleteQueryParamValue           = 32
	CompleteCrudAction                = 64
	CompleteAlias                     = 128
	CompleteLoginLogoutAPI            = 256
	CompleteLoginClientID             = 512
	CompleteLoginClientSecret         = 1024
	CompleteLoginAccountManagementKey = 2048

	CompleteHeaderKey   = 4096
	CompleteHeaderValue = 8192

	CompleteCurrency = 16384
	CompleteBool     = 32768
)
View Source
const (
	Get       = 1
	Create    = 2
	Update    = 4
	Delete    = 8
	GetAll    = 16
	DeleteAll = 32
)

Variables

This section is empty.

Functions

func AddHeaderCompletions added in v0.11.0

func AddHeaderCompletions(hc map[string]*Request)

func Complete

func Complete(c Request) ([]string, cobra.ShellCompDirective)

func GetFilterCompletion added in v0.9.8

func GetFilterCompletion(toComplete string, r resources.Resource) []string

Types

type RegexTree added in v0.9.3

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

func NewRegexCompletionTree added in v0.9.3

func NewRegexCompletionTree() *RegexTree

func (*RegexTree) AddExistingValue added in v0.9.3

func (t *RegexTree) AddExistingValue(v string) error

func (*RegexTree) AddRegex added in v0.9.3

func (t *RegexTree) AddRegex(regex string) error

func (*RegexTree) GetCompletionOptions added in v0.9.3

func (t *RegexTree) GetCompletionOptions() ([]string, error)

type Request

type Request struct {
	Type     int
	Resource resources.Resource

	// These are consumed attributes
	Attributes map[string]string

	// This only makes sense on get, and is largely the current state of the resource.
	ExistingResourceAttributes map[string]string

	SkipWhenChecksAndAddAll bool
	Verb                    int
	Attribute               string
	QueryParam              string
	Header                  string
	// The current string argument being completed
	ToComplete     string
	NoAliases      bool
	AllowTemplates bool
}

Jump to

Keyboard shortcuts

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