ux

package
v1.21.41 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Overview

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries, Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries, Inc. All rights reserved. See the file LICENSE for licensing terms.

Index

Constants

This section is empty.

Variables

View Source
var (
	ALIGN_LEFT   = tw.AlignLeft
	ALIGN_CENTER = tw.AlignCenter
	ALIGN_RIGHT  = tw.AlignRight
)

Alignment constants for backward compatibility

Functions

func ConvertToStringWithThousandSeparator

func ConvertToStringWithThousandSeparator(input uint64) string

func DefaultTable

func DefaultTable(title string, headers []string) *tablewriter.Table

DefaultTable creates a default table with the given title and headers

func ExtraStepExecuted

func ExtraStepExecuted(bar *progressbar.ProgressBar) error

func FormatDuration

func FormatDuration(d time.Duration) string

FormatDuration returns a user friendly string for a duration

func NewUserLog

func NewUserLog(log luxlog.Logger, userwriter io.Writer)

func PrintTableEndpoints

func PrintTableEndpoints(clusterInfo *rpcpb.ClusterInfo)

PrintTableEndpoints prints the endpoints coming from the healthy call

func PrintWait

func PrintWait(cancel chan struct{})

PrintWait does some dot printing to entertain the user

func SpinComplete

func SpinComplete(s *ysmrr.Spinner)

func SpinFailWithError

func SpinFailWithError(s *ysmrr.Spinner, txt string, err error)

func TimedProgressBar

func TimedProgressBar(
	duration time.Duration,
	title string,
	extraSteps int,
) (*progressbar.ProgressBar, error)

Types

type TableCompatWrapper added in v1.9.5

type TableCompatWrapper struct {
	*tablewriter.Table
	// contains filtered or unexported fields
}

TableCompatWrapper provides backward compatibility for tablewriter v0.0.5 API on top of tablewriter v1.0.9+

func CreateCompatTable added in v1.9.5

func CreateCompatTable() *TableCompatWrapper

CreateCompatTable creates a table with v0.0.5-like API

func NewCompatTable added in v1.9.5

func NewCompatTable() *TableCompatWrapper

NewCompatTable creates a new table with v0.0.5-like API

func (*TableCompatWrapper) AppendCompat added in v1.9.5

func (t *TableCompatWrapper) AppendCompat(row []string)

AppendCompat adds a row using string slice (old API)

func (*TableCompatWrapper) SetAlignment added in v1.9.5

func (t *TableCompatWrapper) SetAlignment(align tw.Align)

SetAlignment sets the alignment for rows

func (*TableCompatWrapper) SetAutoMergeCells added in v1.9.5

func (t *TableCompatWrapper) SetAutoMergeCells(enable bool)

SetAutoMergeCells is a no-op in v1.0.9 (merge mode controlled via config)

func (*TableCompatWrapper) SetHeader added in v1.9.5

func (t *TableCompatWrapper) SetHeader(headers []string)

SetHeader sets the headers using the old API

func (*TableCompatWrapper) SetRowLine added in v1.9.5

func (t *TableCompatWrapper) SetRowLine(enable bool)

SetRowLine is a no-op in v1.0.9 (row lines controlled via renderer settings)

type UserLog

type UserLog struct {
	// contains filtered or unexported fields
}
var Logger *UserLog

func (*UserLog) Error

func (ul *UserLog) Error(msg string, args ...interface{})

Error logs an error message

func (*UserLog) GreenCheckmarkToUser

func (ul *UserLog) GreenCheckmarkToUser(msg string, args ...interface{})

GreenCheckmarkToUser prints a green checkmark success message to the user

func (*UserLog) Info

func (ul *UserLog) Info(msg string, args ...interface{})

Info logs an info message

func (*UserLog) PrintError added in v1.21.40

func (ul *UserLog) PrintError(msg string, args ...interface{})

PrintError prints a visible error message with ERROR prefix to the user

func (*UserLog) PrintLineSeparator

func (ul *UserLog) PrintLineSeparator(msg ...string)

PrintLineSeparator prints a line separator

func (*UserLog) PrintToUser

func (ul *UserLog) PrintToUser(msg string, args ...interface{})

PrintToUser prints msg directly on the screen, but also to log file

func (*UserLog) RedXToUser

func (ul *UserLog) RedXToUser(msg string, args ...interface{})

RedXToUser prints a red X error message to the user

type UserSpinner

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

func NewUserSpinner

func NewUserSpinner() *UserSpinner

func (*UserSpinner) SpinToUser

func (us *UserSpinner) SpinToUser(msg string, args ...interface{}) *ysmrr.Spinner

func (*UserSpinner) Stop

func (us *UserSpinner) Stop()

Jump to

Keyboard shortcuts

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