Documentation
¶
Overview ¶
Package factory provides the dependency injection hub for jira-cli commands. IOStreams is eagerly initialized; Config, Auth, and APIClient are lazy.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Factory ¶
type Factory struct {
IOStreams *iostreams.IOStreams
// Global flag values — set by PersistentPreRunE, read by commands.
Profile string // --profile
FlagInstance string // --instance
FlagUser string // --user
FlagToken string // --token
OutputJSON bool // --json
NoColor bool // --no-color
Verbose bool // --verbose (no-op, stored only)
DryRun bool // --dry-run
Quiet bool // --quiet
JQExpr string // --jq
Text bool // --text
// contains filtered or unexported fields
}
Factory is the dependency injection hub for all CLI commands. IOStreams is always available; Config, AuthResolver, and APIClient are initialized lazily on first access so that auth-free commands (--help, config, alias) never trigger credential resolution.
func NewTestFactory ¶
NewTestFactory creates a pre-wired Factory for tests. All lazy accessors are pre-resolved — no credential resolution occurs. Pass nil for any dependency that the test doesn't need.
func (*Factory) APIClient ¶
APIClient returns a configured Jira API client, initializing on first call.
func (*Factory) AuthCredentials ¶
func (f *Factory) AuthCredentials() (*auth.Credentials, error)
AuthCredentials resolves authentication credentials, initializing on first call. Uses the flag > env > profile chain from auth.Resolve().
func (*Factory) ResolveInstance ¶
ResolveInstance returns the Jira instance URL using the same resolution chain as auth (flags → env → config profile) but WITHOUT triggering credential or token resolution. Returns empty string if none is configured.
func (*Factory) TokenStore ¶
func (f *Factory) TokenStore() auth.TokenStore
TokenStore returns the credential store, initializing on first call.