program

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoFilter = &Filter{
	Include: []*regexp.Regexp{regexp.MustCompile(".*")},
	Exclude: []*regexp.Regexp{},
}
View Source
var Version = "unknown"

Functions

func AcceptAllLines

func AcceptAllLines(fields cumulus.Fields) bool

func Display

func Display[T cumulus.Common](ctx context.Context, options Options, list *CommonList, typename string, items chan T)

Types

type Accounts

type Accounts struct {
	List List `cmd:""`
}

type ClusterList added in v0.5.0

type ClusterList struct {
	CommonList `embed:""`
}

func (*ClusterList) Run added in v0.5.0

func (list *ClusterList) Run(program Options) error

type CommonList

type CommonList struct {
	CredentialsFile string   `group:"AWS" short:"c" help:"AWS Credentials File" type:"existingfile" default:"~/.aws/credentials"`
	Include         []string `group:"Output" short:"I" help:"List of field regexps to include"`
	Exclude         []string `group:"Output" short:"X" help:"List of fields regexps to exclude"`
	IncludeAll      bool     `group:"Output" short:"A" help:"Include all fields in output.  This can get wide"`
	ListExpression  []string `` /* 210-byte string literal not displayed */
}

type DBInstanceList added in v0.5.0

type DBInstanceList struct {
	CommonList `embed:""`
}

func (*DBInstanceList) Run added in v0.5.0

func (list *DBInstanceList) Run(program Options) error

type Filter

type Filter struct {
	Include, Exclude []*regexp.Regexp
}

func NewFilter

func NewFilter(include, exclude []string) *Filter

func (*Filter) Accept

func (f *Filter) Accept(meta cumulus.FieldMeta) bool

type InstanceList

type InstanceList struct {
	CommonList `embed:""`
}

func (*InstanceList) Run

func (list *InstanceList) Run(program Options) error

type LineFilter

type LineFilter func(fields cumulus.Fields) bool

func ParseExpression

func ParseExpression(expr string) (LineFilter, error)

func ParseFilter

func ParseFilter(s string) (LineFilter, error)

func ParseFilters

func ParseFilters(s []string) (LineFilter, error)

type List

type List struct {
	CommonList
}

func (*List) Run

func (list *List) Run(program Options) error

type MachineImageList

type MachineImageList struct {
	CommonList `embed:""`
}

func (*MachineImageList) Run

func (list *MachineImageList) Run(program Options) error

type Options

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

	Account  Accounts `cmd:""`
	Instance struct {
		List InstanceList `cmd:""`
	} `cmd:""`
	Snapshot struct {
		List SnapshotList `cmd:""`
	} `cmd:""`
	MachineImage struct {
		List MachineImageList `cmd:""`
	} `cmd:""`
	Volume struct {
		List VolumeList `cmd:""`
	} `cmd:""`

	DNS struct {
		Zone struct {
			List ZoneList `cmd:""`
		} `cmd:""`
		Record struct {
			List RecordList `cmd:""`
		} `cmd:""`
	} `cmd:""`

	RDS struct {
		Cluster struct {
			List ClusterList `cmd:""`
		} `cmd:""`
		Instance struct {
			List DBInstanceList `cmd:""`
		} `cmd:""`
	} `cmd:""`

	SNS struct {
		Topic struct {
			List TopicList `cmd:""`
		} `cmd:""`
		Subscription struct {
			List SubscriptionList `cmd:""`
		} `cmd:""`
	} `cmd:""`

	Debug        bool   `group:"Output" help:"Show debugging information"`
	OutputFormat string `group:"Output" enum:"auto,jsonl,terminal" default:"auto" help:"How to show program output (auto|terminal|jsonl)"`
	Quiet        bool   `group:"Output" short:"q" help:"Be less verbose than usual"`
	Verbose      bool   `group:"Output" short:"v" help:"Be more verbose than usual"`
	Profile      struct {
		CPU    bool `group:"Profile" help:"profile the CPU" hidden:""`
		Memory bool `group:"Profile" help:"profile the Memory usage" hidden:""`
	} `embed:"" prefix:"profile." hidden:""`
}

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() error

Run runs the program

type RecordList

type RecordList struct {
	CommonList `embed:""`
}

func (*RecordList) Run

func (list *RecordList) Run(program Options) error

type RingArray

type RingArray struct {
	Values  []int
	Current int
}

func (*RingArray) Add

func (r *RingArray) Add(val int)

func (RingArray) Average

func (r RingArray) Average() int

type SnapshotList

type SnapshotList struct {
	CommonList `embed:""`
}

func (*SnapshotList) Run

func (list *SnapshotList) Run(program Options) error

type SubscriptionList added in v0.4.0

type SubscriptionList struct {
	CommonList `embed:""`
}

func (*SubscriptionList) Run added in v0.4.0

func (list *SubscriptionList) Run(program Options) error

type TopicList added in v0.4.0

type TopicList struct {
	CommonList `embed:""`
}

func (*TopicList) Run added in v0.4.0

func (list *TopicList) Run(program Options) error

type VersionCmd

type VersionCmd struct{}

VersionCmd prints the program version

func (*VersionCmd) Run

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

type VolumeList

type VolumeList struct {
	CommonList `embed:""`
}

func (*VolumeList) Run

func (list *VolumeList) Run(program Options) error

type ZoneList

type ZoneList struct {
	CommonList `embed:""`
}

func (*ZoneList) Run

func (list *ZoneList) Run(program Options) error

Jump to

Keyboard shortcuts

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