cli

package
v1.70.2 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: Apache-2.0 Imports: 21 Imported by: 8

Documentation

Overview

Package cli contains various cli utilities that are useful for building cli applications with gobox based applications

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HookInUrfaveCLI

func HookInUrfaveCLI(ctx context.Context, cancel context.CancelFunc, a *cli.App,
	logger logrus.FieldLogger, honeycombAPIKey, dataset, teleforkAPIKey string)

HookInUrfaveCLI sets up an app.Before that automatically traces command runs and automatically updates itself.

TODO(jaredallard): Deprecate this after templates have been updated and released for a few weeks.

func Run added in v1.66.0

func Run(ctx context.Context, cancel context.CancelFunc, a *cli.App, conf *Config)

Run runs a urface/cli application.

Types

type Config added in v1.66.0

type Config struct {
	// Telemetry is the configuration for telemetry for the CLI
	Telemetry TelemetryConfig

	// Logger is the logger to use for logging
	Logger logrus.FieldLogger
}

Config configures the CLI integration provided by gobox

type TelemetryConfig added in v1.66.0

type TelemetryConfig struct {
	// UseDelibird enables the delibird integration, which logs all output to a
	// file as frames (writes to the terminal) as well as records traces.
	//
	// These files will not be automatically uploaded, a daemon must be running on
	// the user's local machine to upload them. For Outreach, this is uploaded by the
	// orc 'delibird' daemon. For other users, these are kept locally.
	UseDelibird bool

	// Otel is the configuration for telemetry when delibird is not in use.
	Otel TelemetryOtelConfig
}

TelemetryConfig is the configuration for telemetry for the CLI

type TelemetryOtelConfig added in v1.66.0

type TelemetryOtelConfig struct {
	// HoneycombAPIKey is the honeycomb API key to use for telemetry.
	HoneycombAPIKey cfg.SecretData

	// Dataset is the dataset to send telemetry to.
	Dataset string

	// Debug enables debug logging for telemetry.
	Debug bool
}

TelemetryOtelConfig is the configuration for telemetry when delibird is not in use.

Directories

Path Synopsis
Package aws contains helpers for working with AWS in CLIs
Package aws contains helpers for working with AWS in CLIs
Description: Implements consistent ways to get Auth across platforms.
Description: Implements consistent ways to get Auth across platforms.
Package logfile implements a hook that will re-run the current process with a PTY attached to it, and then hook into the PTY's stdout/stderr to record logs.
Package logfile implements a hook that will re-run the current process with a PTY attached to it, and then hook into the PTY's stdout/stderr to record logs.
Description: Provides miscellaneous helpers for the updater
Description: Provides miscellaneous helpers for the updater
archive
Package archive contains methods for extracting file(s) from arbitrary archive types.
Package archive contains methods for extracting file(s) from arbitrary archive types.
release
Package release contains methods that interact with releases from VCS providers that do not exist natively in git.
Package release contains methods that interact with releases from VCS providers that do not exist natively in git.
resolver
Package resolver contains a git tag aware version resolver that supports channels to determine the latest version.
Package resolver contains a git tag aware version resolver that supports channels to determine the latest version.

Jump to

Keyboard shortcuts

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