program

package
v0.0.0-...-fa7141a Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Number     = regexp.MustCompile(`^[0-9]+$`)
	Percentage = regexp.MustCompile(`^[0-9\\.]+%$`)
	Multiply   = regexp.MustCompile(`^[0-9\\.]+x$`)
)
View Source
var (
	Max = Mark{"|", math.MaxInt}
)
View Source
var Version = "unknown"

Functions

This section is empty.

Types

type Hpa

type Hpa struct {
	Minimum    string            `aliases:"min" help:"Set minimum to this number"`
	Maximum    string            `aliases:"max" help:"Set maximum to this number"`
	CPUTarget  int               `aliases:"cpu" help:"Set scaling target"`
	Info       bool              `help:"Show information about the HPAs"`
	Kubeconfig string            `help:"Path to the kubeconfig file" type:"path" default:"~/.kube/config"`
	Namespace  string            `short:"n" help:"Namespace to modify HPAs in"`
	Context    string            `help:"Context to use in kubeconfig"`
	Labels     map[string]string `short:"l" help:"Label filters to select HPAs"`
	All        bool              `help:"Modify all HPAs in the namespace"`
	HPAList    []string          `arg:"" optional:"" help:"Names of specific HPAs to modify"`
}

func (*Hpa) Run

func (program *Hpa) Run(options *Options) error

type Mark

type Mark struct {
	// Character to use as the marker
	Mark string
	// Position of the mark between 0 and max
	Postion int
}

type Options

type Options struct {
	Version bool `help:"Show program version"`

	Debug        bool   `group:"Info" help:"Show debugging information"`
	DryRun       bool   `group:"Info" help:"Do not modify anything"`
	OutputFormat string `group:"Info" enum:"auto,jsonl,terminal" default:"auto" help:"How to show program output (auto|terminal|jsonl)"`
	Quiet        bool   `group:"Info" help:"Be less verbose than usual"`
	Hpa          Hpa    `cmd:"" help:"Horizontal Pod Autoscaler operations"`
}

Options is the structure of program options

func (*Options) AfterApply

func (program *Options) AfterApply() error

AfterApply runs after the options are parsed but before anything runs

func (*Options) Parse

func (program *Options) Parse(args []string) (*kong.Context, error)

Parse calls the CLI parsing routines

func (*Options) Run

func (program *Options) Run(options *Options) error

Run runs the program

type VersionCmd

type VersionCmd struct{}

VersionCmd prints the program version

func (*VersionCmd) Run

func (v *VersionCmd) Run(program *Options) error

Jump to

Keyboard shortcuts

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