adfmode

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package adfmode resolves the strict vs best-effort ADF mode for a given CLI invocation, applying both the precedence ladder and per-path defaults.

Precedence (highest first): command flag > JIRA_ADF_STRICT env > profile adf_strict > per-path default (read/render → best-effort, mutation submit → strict). The resolver is the only place mode selection happens; commands pass their resolved Mode into pkg/adf entry points.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FlagChoice

type FlagChoice uint8

FlagChoice is a bitmask so the resolver can detect if the caller wired both --adf-strict and --adf-best-effort on the same invocation (a programmer error — cobra mutex should prevent it, but we defend anyway).

const (
	FlagUnset      FlagChoice = 0
	FlagStrict     FlagChoice = 1 << 0
	FlagBestEffort FlagChoice = 1 << 1
)

type Inputs

type Inputs struct {
	Flag    FlagChoice
	Env     string // raw value of JIRA_ADF_STRICT
	Profile *bool  // nil = unset
	Path    Path
}

Inputs is the resolver input set. All fields are optional; zero values map to "unset" and the resolver falls through to the next precedence level.

type Mode

type Mode int

Mode is the resolved ADF processing mode for a single invocation.

const (
	ModeBestEffort Mode = iota
	ModeStrict
)

func Resolve

func Resolve(in Inputs) (Mode, error)

Resolve returns the ADF Mode for the given inputs.

func (Mode) String

func (m Mode) String() string

type Path

type Path int

Path is the kind of ADF interaction this invocation performs. It selects the default mode when no higher-priority signal is set.

const (
	PathRead Path = iota
	PathRender
	PathPlainExtract
	PathRawEmit
	PathMutationSubmit
	PathDryRun
)

Jump to

Keyboard shortcuts

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