completion

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 10 Imported by: 0

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
)
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]int
	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