Documentation
¶
Index ¶
- func IsDebug(cmd *cobra.Command) bool
- func IsDryRun(cmd *cobra.Command) bool
- func IsJSONDryRun(cmd *cobra.Command) bool
- func NewClient(cmd *cobra.Command, allowedSecurityFields ...string) (*sdk.CompassCLI, error)
- func NewDryRunBody(length int64) io.ReadCloser
- type DebugClient
- type DryRunClient
- type HTTPClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsDebug ¶
IsDebug returns true when --debug is set and --dry-run is not. When both flags are set, dry-run takes precedence.
func IsJSONDryRun ¶ added in v0.1.68
func NewClient ¶
NewClient creates a new SDK client configured from command flags and environment. It handles global security, server URL/selection override, global parameters, retry configuration, timeout, and test client injection. Empty allowedSecurityFields accepts every global security alternative.
func NewDryRunBody ¶ added in v0.1.68
func NewDryRunBody(length int64) io.ReadCloser
NewDryRunBody returns an empty body that previews as <bytes:length> under --dry-run.
Types ¶
type DebugClient ¶
type DebugClient struct {
Inner HTTPClient
Stderr io.Writer
}
DebugClient wraps an HTTP client and logs request/response diagnostics to stderr.
type DryRunClient ¶
DryRunClient intercepts HTTP requests and returns a synthetic response without making any network calls.
type HTTPClient ¶
HTTPClient is the interface that SDK clients implement.
func WrapClientForDiagnostics ¶
func WrapClientForDiagnostics(cmd *cobra.Command, inner HTTPClient) HTTPClient
WrapClientForDiagnostics wraps an HTTP client based on diagnostics mode. Returns the original client if no diagnostics flags are set.