contract

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package contract carries the two facts a refused CLI contract needs on both sides of the command boundary: the sentinel a command returns once it has printed its JSON refusal, and the exit status main gives it.

It is a package of its own, and not part of pkg/cmds/internal/utils, only because cmd/canary lives outside that internal tree and must be able to recognise the sentinel Execute hands back.

Index

Constants

View Source
const ExitCode = 2

ExitCode is the exit status a contract refusal uses. It is distinct from 1 so a caller can tell "canary refused because you asked for something it will not do" from "the command failed".

Variables

View Source
var ErrFailed = errors.New("contract refused")

ErrFailed is the sentinel a command returns once it has already printed its contract line. main maps it to ExitCode; nothing prints it, because the JSON line on stdout is the entire message.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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