ui

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	P0 = Priority(iota)
	P1
	P2
	P3
	P4
	P5
)

Variables

View Source
var CLIErrorTreeEncoder interfaces.EncoderToWriter[error] = encoder{}
View Source
var MakeTestCaseInfo = test_ui.MakeTestCaseInfo
View Source
var Null null
View Source
var (
	SetOutput = log.SetOutput
)

Functions

func GetHumanBytesString

func GetHumanBytesString(bytes uint64) string

func GetHumanBytesStringOrError

func GetHumanBytesStringOrError(bytes int64) string

func IsVerbose

func IsVerbose() bool

func MakePrefixPrinter

func MakePrefixPrinter(printer Printer, prefix string) prefixPrinter

func MakePrinter

func MakePrinter(file *os.File) printer

func MakePrinterFromWriter

func MakePrinterFromWriter(w io.Writer) printer

func MakePrinterOn

func MakePrinterOn(file *os.File, on bool) printer

func SetTesting

func SetTesting()

func SetTodoOn

func SetTodoOn()

func SetVerbose

func SetVerbose(on bool)

TODO add compile-time determined verbosity for testing / debugging

func Todo

func Todo(f string, a ...any) (err error)

func TodoP0

func TodoP0(f string, a ...any) (err error)

func TodoP1

func TodoP1(f string, a ...any) (err error)

func TodoP2

func TodoP2(f string, a ...any) (err error)

func TodoP3

func TodoP3(f string, a ...any) (err error)

func TodoP4

func TodoP4(f string, a ...any) (err error)

func TodoP5

func TodoP5(f string, a ...any) (err error)

Types

type DevPrinter

type DevPrinter interface {
	Printer
	Caller(skip int) Printer
	FunctionName(skip int)
	Stack(skip, count int)
}

TODO make utility functions

func Debug

func Debug() DevPrinter

func DebugAllowCommit

func DebugAllowCommit() DevPrinter

func DebugBatsTestBody

func DebugBatsTestBody() DevPrinter

TODO replace with a dynamic `DebugOnEnv("BATS_TEST_BODY")`

func Log

func Log() DevPrinter

type HumanReadableBytes

type HumanReadableBytes string

func (HumanReadableBytes) GetByteCount

func (h HumanReadableBytes) GetByteCount() uint64

func (*HumanReadableBytes) Set

func (h *HumanReadableBytes) Set(v string) error

func (HumanReadableBytes) String

func (h HumanReadableBytes) String() string

type Printer

type Printer = interfaces.Printer

func Err

func Err() Printer

func Out

func Out() Printer

type Priority

type Priority int

func (Priority) String

func (i Priority) String() string

type TestCase

type TestCase[BLOB any] = test_ui.TestCase[BLOB]

func MakeTestCase

func MakeTestCase[BLOB any](name string, blob BLOB) TestCase[BLOB]

type TestCaseInfo

type TestCaseInfo = test_ui.TestCaseInfo

Source Files

  • bytes.go
  • cli_error_tree_coder.go
  • cli_error_tree_state.go
  • cli_error_tree_state_stack.go
  • errors.go
  • main.go
  • printer.go
  • printer_dev.go
  • printer_null.go
  • printer_optional.go
  • printer_prefix.go
  • priority_string.go
  • test_case.go
  • todo.go

Jump to

Keyboard shortcuts

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