cli

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: BSD-3-Clause-Clear Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// top level actions
	ActionGet          = "get"
	ActionList         = "list"
	ActionCreate       = "create"
	ActionUpdate       = "update"
	ActionUpdateUnsafe = "unsafely update"
	ActionDeactivate   = "deactivate"
	ActionReactivate   = "reactivate"
	ActionDelete       = "delete"

	// text input names
	InputNameFQN        = "fully qualified name (FQN)"
	InputNameFQNUpdated = "deprecated fully qualified name (FQN) being altered"
)

Variables

This section is empty.

Functions

func AskForInput added in v0.10.0

func AskForInput(message string) string

func AskForSecret added in v0.10.0

func AskForSecret(message string) string

func CommaSeparated

func CommaSeparated(values []string) string

func ConfirmAction

func ConfirmAction(action, resource, id string, force bool)

func ConfirmTextInput

func ConfirmTextInput(action, resource, inputName, shouldMatchValue string)

func ConstructMetadata

func ConstructMetadata(m *common.Metadata) map[string]string

func ErrorMessage

func ErrorMessage(msg string, err error) string

func ExitWithError

func ExitWithError(errMsg string, err error)

func ExitWithNotFoundError

func ExitWithNotFoundError(errMsg string, err error)

func ExitWithWarning

func ExitWithWarning(warnMsg string)

func FooterMessage

func FooterMessage(msg string) string

func GetState

func GetState(cmd *cobra.Command) common.ActiveStateEnum

Transforms into enum value and defaults to active state

func NewTable

func NewTable(cols ...table.Column) table.Model

func NewTabular

func NewTabular(rows ...[]string) table.Model

func NewUUIDColumn

func NewUUIDColumn() table.Column

func PrintSuccessTable

func PrintSuccessTable(cmd *cobra.Command, id string, t table.Model)

func ReadFromArgsOrPipe

func ReadFromArgsOrPipe(args []string, pipe *os.File) []byte

func ReadFromFile

func ReadFromFile(filePath string) []byte

func ReadFromPipe

func ReadFromPipe(in *os.File) []byte

func SuccessMessage

func SuccessMessage(msg string) string

func TermWidth

func TermWidth() int

func WarningMessage

func WarningMessage(msg string) string

Types

type Color

type Color struct {
	Foreground lipgloss.CompleteAdaptiveColor
	Background lipgloss.CompleteAdaptiveColor
}

type FlagHelper

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

func NewFlagHelper

func NewFlagHelper(cmd *cobra.Command) *FlagHelper

func (FlagHelper) GetOptionalBool

func (f FlagHelper) GetOptionalBool(flag string) bool

func (FlagHelper) GetOptionalString

func (f FlagHelper) GetOptionalString(flag string) string

func (FlagHelper) GetRequiredBool

func (f FlagHelper) GetRequiredBool(flag string) bool

func (FlagHelper) GetRequiredInt32

func (f FlagHelper) GetRequiredInt32(flag string) int32

func (FlagHelper) GetRequiredString

func (f FlagHelper) GetRequiredString(flag string) string

func (FlagHelper) GetStringSlice

func (f FlagHelper) GetStringSlice(flag string, v []string, opts FlagHelperStringSliceOptions) []string

type FlagHelperStringSliceOptions

type FlagHelperStringSliceOptions struct {
	Min int
	Max int
}

type Printer added in v0.10.0

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

func NewPrinter added in v0.10.0

func NewPrinter(enabled bool) *Printer

func (*Printer) Print added in v0.10.0

func (p *Printer) Print(args ...interface{})

func (*Printer) Printf added in v0.10.0

func (p *Printer) Printf(format string, args ...interface{})

func (*Printer) Println added in v0.10.0

func (p *Printer) Println(args ...interface{})

type SimpleAttribute

type SimpleAttribute struct {
	Id        string
	Name      string
	Rule      string
	Values    []string
	Namespace string
	Active    string
	Metadata  map[string]string
}

func GetSimpleAttribute

func GetSimpleAttribute(a *policy.Attribute) SimpleAttribute

type SimpleAttributeValue

type SimpleAttributeValue struct {
	Id       string
	FQN      string
	Active   string
	Metadata map[string]string
}

func GetSimpleAttributeValue

func GetSimpleAttributeValue(v *policy.Value) SimpleAttributeValue

Jump to

Keyboard shortcuts

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