cmd

package
v1.19.2 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SummaryPath = "licensing/licences.csv"
	DetailsPath = "licensing/all_licences.csv"
)

Variables

View Source
var GDNACmd = &cobra.Command{
	Use:   "gdna [FLAGS...]",
	Short: "Process Geneos License Usage Data",
	Long:  rootCmdDescription,
	Args:  cobra.ArbitraryArgs,
	CompletionOptions: cobra.CompletionOptions{
		DisableDefaultCmd: true,
	},
	Version:               cordial.VERSION,
	DisableAutoGenTag:     true,
	DisableSuggestions:    true,
	DisableFlagsInUseLine: true,
	PersistentPreRunE: func(cmd *cobra.Command, args []string) (err error) {
		if daemon {
			return process.Daemon(nil, process.RemoveArgs, "-D", "--daemon")
		}

		initConfig(cmd)

		if !cf.IsSet("gdna.version") {
			cf.Set("gdna.version", cordial.VERSION)
		}

		return
	},
}

GDNACmd represents the base command when called without any subcommands

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

Types

type Allocation added in v1.18.0

type Allocation struct {
	Name       string     `mapstructure:"name"`
	Token      string     `mapstructure:"token"`
	Allocation int        `mapstructure:"allocation"`
	Comment    string     `mapstructure:"comment,omitempty"`
	User       string     `mapstructure:"user,omitempty"`
	Origin     string     `mapstructure:"origin"`
	Timestamp  *time.Time `mapstructure:"timestamp,omitempty"`
}

type Filter added in v1.18.0

type Filter struct {
	Name      string     `mapstructure:"name"`
	Pattern   []string   `mapstructure:"pattern"`
	Comment   string     `mapstructure:"comment,omitempty"`
	User      string     `mapstructure:"user,omitempty"`
	Origin    string     `mapstructure:"origin"`
	Timestamp *time.Time `mapstructure:"timestamp,omitempty"`
}

type Group added in v1.18.0

type Group struct {
	Name      string     `mapstructure:"name"`
	Patterns  []string   `mapstructure:"patterns"`
	Comment   string     `mapstructure:"comment,omitempty"`
	User      string     `mapstructure:"user,omitempty"`
	Origin    string     `mapstructure:"origin"`
	Timestamp *time.Time `mapstructure:"timestamp,omitempty"`
}

type Report

type Report struct {
	// remember to "squash" the embedded struct to UnmarshalKey() works right
	reporter.Report `mapstructure:",squash"`

	// gdna / SQL query specific
	Subreport string `mapstructure:"-"`
	Type      string `mapstructure:"type,omitempty"`
	Query     string `mapstructure:"query,omitempty"`
	Headlines string `mapstructure:"headlines,omitempty"`

	// when Type = "split" then
	SplitColumn    string `mapstructure:"split-column,omitempty"`
	SplitValues    string `mapstructure:"split-values-query,omitempty"`
	SplitValuesAll string `mapstructure:"split-values-query-all,omitempty"`

	Grouping      string   `mapstructure:"grouping,omitempty"`
	GroupingOrder []string `mapstructure:"grouping-order,omitempty"`
}

Reporter is the GDNA specific reporter struct

Jump to

Keyboard shortcuts

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