cmd

package
v1.30.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// SummaryPath TODO: Describe its purpose and intended use.
	SummaryPath = "licensing/licences.csv"
	// DetailsPath TODO: Describe its purpose and intended use.
	DetailsPath = "licensing/all_licences.csv"
)
View Source
const SourcesOptionsText = "Override configured licence source.\n(Repeat as required)"

SourcesOptionsText TODO: Describe its purpose and intended use.

Variables

View Source
var Cmd = &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, nil, process.RemoveArgs, "-D", "--daemon")
		}

		initConfig(cmd)

		if v, ok := config.Lookup[string](cf, cf.Join("gdna", "version")); !ok || v == "" {
			config.Set(cf, cf.Join("gdna", "version"), cordial.VERSION)
		}

		return
	},
}

Cmd 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

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"`
}

Allocation TODO: Describe its purpose and intended use.

type Filter

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"`
}

Filter TODO: Describe its purpose and intended use.

type Group

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"`
}

Group TODO: Describe its purpose and intended use.

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

type Sources

type Sources []string

Sources is a slice of licence data sources

func (*Sources) Set

func (i *Sources) Set(value string) error

Set TODO: Document its behavior, inputs, and effects.

func (*Sources) String

func (i *Sources) String() string

String TODO: Document its behavior, inputs, and effects.

func (*Sources) Type

func (i *Sources) Type() string

Type TODO: Document its behavior, inputs, and effects.

Jump to

Keyboard shortcuts

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