cmd

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: Apache-2.0 Imports: 86 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultObjectBatchSize is the number of objects to batch before flushing.
	// Tuned for memory efficiency on large buckets (1M+ objects).
	DefaultObjectBatchSize = 5000

	// DefaultPrefixBatchSize is the number of prefixes to batch before flushing.
	// Prefixes are fewer than objects, so smaller batches are fine.
	DefaultPrefixBatchSize = 1000

	// DefaultFlushTimeout is the timeout for final flush operations in Close().
	// Prevents indefinite hangs if the database stalls.
	DefaultFlushTimeout = 2 * time.Minute
)

Default batch sizes and timeouts for streaming ingestion.

Variables

This section is empty.

Functions

func Execute

func Execute() error

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func ExitWithCode

func ExitWithCode(logger *logging.Logger, exitCode foundry.ExitCode, msg string, err error)

ExitWithCode exits the program with a semantic foundry exit code and logs the error. This helper ensures consistent error logging with exit code metadata before exiting.

Parameters:

  • logger: The logger to use for error output (can be nil for early failures)
  • exitCode: The foundry exit code constant (e.g., foundry.ExitConfigInvalid)
  • msg: Human-readable error message
  • err: The underlying error (can be nil)

func ExitWithCodeStderr

func ExitWithCodeStderr(exitCode foundry.ExitCode, msg string, err error)

ExitWithCodeStderr is a variant that writes to stderr without a logger. Use this for early failures before logger initialization.

Parameters:

  • exitCode: The foundry exit code constant
  • msg: Human-readable error message
  • err: The underlying error (can be nil)

func ExitWithCodeWriter

func ExitWithCodeWriter(w io.Writer, exitCode foundry.ExitCode, msg string, err error)

ExitWithCodeWriter exits with a semantic foundry exit code, writing plain diagnostic output to the supplied writer instead of using the CLI logger.

func GetAppIdentity

func GetAppIdentity() *appidentity.Identity

GetAppIdentity returns the loaded app identity (only valid after initConfig)

func IsReadOnly

func IsReadOnly() bool

IsReadOnly reports whether the CLI is running with provider-side mutations disabled. It can be enabled via `--readonly` or by setting the environment variable `GONIMBUS_READONLY=1`.

func ProbeExitCode

func ProbeExitCode(err error) (foundry.ExitCode, bool)

ProbeExitCode recognizes only content-probe's typed outcome. Other command errors retain their existing process dispatch, regardless of message text.

func SetVersionInfo

func SetVersionInfo(version, commit, buildDate string)

SetVersionInfo is called by main package to set version information

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

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