appctx

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 9 Imported by: 0

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.

Jump to

Keyboard shortcuts

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