util

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const AutoDownloadFolderPerm = 0755

Variables

View Source
var Fatal = fatalError
View Source
var LoggingMode = logger.LogModeDefault
View Source
var ShutdownSignals = []os.Signal{
	os.Interrupt,
	syscall.SIGTERM,
}
View Source
var SystemManagerKey = contextKey{/* contains filtered or unexported fields */}

Functions

func ApplyPorcelainLogLevel

func ApplyPorcelainLogLevel(cmd *cobra.Command, _ []string)

ApplyPorcelainLogLevel sets the log level of loggers running on user-facing "porcelain" commands to be zerolog.FatalLevel to reduce noise shown to users.

func CheckVersion

func CheckVersion(cmd *cobra.Command, args []string) error

func DownloadResultsHandler

func DownloadResultsHandler(
	ctx context.Context,
	cmd *cobra.Command,
	jobID string,
	downloadSettings *cliflags.DownloaderSettings,
) error

func EnsureValidVersion

func EnsureValidVersion(ctx context.Context, clientVersion, serverVersion *models.BuildVersionInfo) error

func ExecuteJob

func ExecuteJob(ctx context.Context,
	j *model.Job,
	runtimeSettings *cliflags.RunTimeSettings,
) (*model.Job, error)

func FakeFatalErrorHandler

func FakeFatalErrorHandler(cmd *cobra.Command, msg error, code int)

FakeFatalErrorHandler captures the error for testing, responsibility of the test to handle the exit (if any) NOTE: If your test is not idempotent, you can cause side effects (the underlying function will continue to run) Returned as text JSON to wherever RootCmd is printing.

func GetAPIClient

func GetAPIClient(ctx context.Context) *client.APIClient

func GetAPIClientV2

func GetAPIClientV2(ctx context.Context) *clientv2.Client

func GetCleanupManager

func GetCleanupManager(ctx context.Context) *system.CleanupManager

func GetDefaultJobFolder

func GetDefaultJobFolder(jobID string) string

func Logs

func Logs(cmd *cobra.Command, jobID string, follow, history bool) error

func ReadFromStdinIfAvailable

func ReadFromStdinIfAvailable(cmd *cobra.Command) ([]byte, error)

Types

type Msg

type Msg struct {
	Tag          uint8
	Data         string
	ErrorMessage string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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