Help us shape the future of Go! Take the 2026 Go Developer Survey

machine

package
v0.4.14 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const ContractVersion = "v1"

Variables

This section is empty.

Functions

func CapabilitySpecifications

func CapabilitySpecifications() []string

Types

type Error

type Error struct {
	Code      ErrorCode `json:"code"`
	Message   string    `json:"message"`
	Retryable bool      `json:"retryable,omitempty"`
	Next      string    `json:"next,omitempty"`
	Cause     error     `json:"-"`
}

func Classify

func Classify(err error) *Error

func NewError

func NewError(code ErrorCode, message, next string, retryable bool) *Error

func Wrap

func Wrap(code ErrorCode, err error, next string, retryable bool) *Error

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type ErrorCode

type ErrorCode string
const (
	ErrorValidationFailed    ErrorCode = "validation_failed"
	ErrorPolicyDenied        ErrorCode = "policy_denied"
	ErrorConflict            ErrorCode = "conflict"
	ErrorOwnershipAmbiguous  ErrorCode = "ownership_ambiguous"
	ErrorProviderUnavailable ErrorCode = "provider_unavailable"
	ErrorRuntimeUnavailable  ErrorCode = "runtime_unavailable"
	ErrorTimeout             ErrorCode = "timeout"
	ErrorVerificationFailed  ErrorCode = "verification_failed"
	ErrorUnsupported         ErrorCode = "unsupported_operation"
	ErrorInternal            ErrorCode = "internal_error"
)

type ErrorResult

type ErrorResult struct {
	ContractVersion string `json:"contract_version"`
	Error           *Error `json:"error"`
}

func ResultError

func ResultError(err error) ErrorResult

type Operation

type Operation struct {
	ID                   string      `json:"id"`
	Description          string      `json:"description"`
	Safety               SafetyClass `json:"safety"`
	ConfirmationRequired bool        `json:"confirmation_required"`
	PolicyRequired       bool        `json:"policy_required"`
	ContractVersion      string      `json:"contract_version"`
}

func Operations

func Operations() []Operation

type SafetyClass

type SafetyClass string
const (
	SafetyReadOnly    SafetyClass = "read_only"
	SafetyMutating    SafetyClass = "mutating"
	SafetyDestructive SafetyClass = "destructive"
)

Jump to

Keyboard shortcuts

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