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

batches

package
v1.42.4 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure(root *cli.Command, options Options)

Configure registers local batch workflows around the generated commands.

func InterruptedError

func InterruptedError(failure error) bool

InterruptedError reports cancellation or timeout of a local batch workflow.

func RunBatchDirectoryHelper

func RunBatchDirectoryHelper(args []string) (bool, error)

RunBatchDirectoryHelper creates a directory without changing the parent's umask or changing permissions through a replaceable pathname.

func RunBatchOutputHelper

func RunBatchOutputHelper(args []string) (bool, error)

RunBatchOutputHelper handles the private byte-copy process before CLI parsing. The helper owns no API client or saved files. Its lifeline stops blocked writes if the parent disappears, without changing the inherited stdout descriptor.

func ShowNextCommand

func ShowNextCommand(batch gjson.Result, opts HintOptions) error

ShowNextCommand renders a safe follow-up hint after batch creation.

func WithErrorOutput

func WithErrorOutput(failure error, out io.Writer, render func(context.Context, io.Writer) error) error

WithErrorOutput gives cancellation diagnostics a separate bounded delivery window. A failed delivery must not trigger another unbounded write to the same error sink.

Types

type HintOptions

type HintOptions struct {
	Context       context.Context
	Route         string
	Response      bool
	Terminal      bool
	Transform     string
	RawOutput     bool
	Format        string
	Stderr        io.Writer
	HumanTerminal func(context.Context, *cli.Command) bool
}

HintOptions carries the final destination and format policy for batch receipts.

type Options

type Options struct {
	DefaultRequestOptions func(*cli.Command) []option.RequestOption
	RequestOptions        func(*cli.Command, io.Reader) ([]option.RequestOption, error)
	ShowResult            func(context.Context, *cli.Command, gjson.Result, string, io.Writer, io.Writer) error
	HumanTerminal         func(context.Context, *cli.Command) bool
	APIErrorMessage       func(*cli.Command, error, *openai.Error) string
}

Options connects batch workflows to application request and presentation policies. Assembly supplies every callback, retaining feature middleware and output policy.

type WorkflowError

type WorkflowError struct {
	// contains filtered or unexported fields
}

WorkflowError contains only local guidance, never API prose or paths.

func (*WorkflowError) Error

func (e *WorkflowError) Error() string

func (*WorkflowError) ExitCode

func (e *WorkflowError) ExitCode() int

func (*WorkflowError) Unwrap

func (e *WorkflowError) Unwrap() error

Jump to

Keyboard shortcuts

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