Documentation
¶
Index ¶
- func Check() *cobra.Command
- func Config() *cobra.Command
- func HandleError(err error, quiet bool)
- func List() *cobra.Command
- func LoadPolicyFromConfig(config *GlobalConfig) (*grant.Policy, error)
- func OutputResult(result *grant.RunResponse, format string, outputFile string) error
- func SetupLogging(verbose bool)
- func Version() *cobra.Command
- type FullConfig
- type GlobalConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleError ¶ added in v0.3.0
HandleError handles command errors consistently
func LoadPolicyFromConfig ¶ added in v0.3.0
func LoadPolicyFromConfig(config *GlobalConfig) (*grant.Policy, error)
LoadPolicyFromConfig loads policy based on global config
func OutputResult ¶ added in v0.3.0
func OutputResult(result *grant.RunResponse, format string, outputFile string) error
OutputResult outputs the result in the specified format
func SetupLogging ¶ added in v0.3.1
func SetupLogging(verbose bool)
SetupLogging configures logging based on verbose flag
Types ¶
type FullConfig ¶ added in v0.3.0
type FullConfig struct {
// Global CLI options
Config string `yaml:"config,omitempty"`
Format string `yaml:"format"`
Quiet bool `yaml:"quiet"`
Verbose bool `yaml:"verbose"`
// Core policy configuration (fields from grant.Policy but without omitempty for booleans)
Allow []string `yaml:"allow,omitempty"`
IgnorePackages []string `yaml:"ignore-packages"`
RequireLicense bool `yaml:"require-license"`
RequireKnownLicense bool `yaml:"require-known-license"`
// Command-specific options
DisableFileSearch bool `yaml:"disable-file-search"`
Summary bool `yaml:"summary"`
OnlyUnlicensed bool `yaml:"only-unlicensed"`
}
FullConfig represents all possible configuration options for Grant This struct combines policy options with CLI options that can be set in config
type GlobalConfig ¶ added in v0.3.0
type GlobalConfig struct {
ConfigFile string
OutputFormat string
OutputFile string
Quiet bool
Verbose bool
NoOutput bool
}
GlobalConfig holds configuration that applies to all commands
func GetGlobalConfig ¶ added in v0.3.0
func GetGlobalConfig(cmd *cobra.Command) *GlobalConfig
GetGlobalConfig extracts global configuration from cobra command
Click to show internal directories.
Click to hide internal directories.