Documentation
¶
Overview ¶
Package appctx provides the execution context for CLI commands.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RunContext ¶
type RunContext struct {
Config *config.Config
FileConfig *config.Config
Format string
Color bool
Verbose bool
Quiet bool
Debug bool
Force bool
NoInput bool
ServiceFlag string // --service override
Writer *output.Writer
Store *service.Store
ScanCache *scan.Cache
}
RunContext holds all resolved state for a command execution.
func New ¶
func New(flagOverrides map[string]string, serviceFlag string, format string, verbose, quiet, debug, force, noInput bool) (*RunContext, error)
New creates a RunContext from flags and config.
func (*RunContext) ActiveServiceID ¶
func (rc *RunContext) ActiveServiceID() (string, error)
ActiveServiceID returns the active service ID (flag > config).
func (*RunContext) LoadScanResult ¶
func (rc *RunContext) LoadScanResult() *scan.Result
LoadScanResult loads the scan cache for the active service, or nil if unavailable.
func (*RunContext) NewAPIClient ¶
func (rc *RunContext) NewAPIClient() (*api.Client, error)
NewAPIClient creates an API client for the active service.
Click to show internal directories.
Click to hide internal directories.