utils

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StyleSymbols = map[string]string{
	"pass":    "✓",
	"fail":    "✗",
	"warning": "!",
	"pending": "○",
	"info":    "ℹ",
	"arrow":   "→",
	"bullet":  "•",
	"dot":     "·",
}

Functions

func PrintProgressBar added in v0.6.11

func PrintProgressBar(current, total int, width int) string

func SliceSame

func SliceSame(slice1, slice2 []any) bool

Types

type Dictionary

type Dictionary map[string]any

func (Dictionary) UnwindBool

func (d Dictionary) UnwindBool(keys ...string) bool

func (Dictionary) UnwindFloat32

func (d Dictionary) UnwindFloat32(keys ...string) float32

func (Dictionary) UnwindFloat64

func (d Dictionary) UnwindFloat64(keys ...string) float64

func (Dictionary) UnwindInt

func (d Dictionary) UnwindInt(keys ...string) int

func (Dictionary) UnwindInt32

func (d Dictionary) UnwindInt32(keys ...string) int32

func (Dictionary) UnwindInt64

func (d Dictionary) UnwindInt64(keys ...string) int64

func (Dictionary) UnwindMap

func (d Dictionary) UnwindMap(keys ...string) Dictionary

func (Dictionary) UnwindSlice

func (d Dictionary) UnwindSlice(keys ...string) []any

func (Dictionary) UnwindString

func (d Dictionary) UnwindString(keys ...string) string

func (Dictionary) UnwindUint

func (d Dictionary) UnwindUint(keys ...string) uint

func (Dictionary) UnwindUint64

func (d Dictionary) UnwindUint64(keys ...string) uint64

func (Dictionary) UnwindValue

func (d Dictionary) UnwindValue(keys ...string) any

UnwindValue safely navigates and retrieves values from nested maps

type ErrorReport added in v0.6.11

type ErrorReport struct {
	FunctionName string
	Error        error
	Time         time.Time
}

type FunctionOutput

type FunctionOutput struct {
	Name        string
	Status      string
	Message     string
	StreamLines []string
	Complete    bool
	StartTime   time.Time
	LastUpdated time.Time
	Error       error
	Tables      map[string]*Table // Function tables
	Index       int
}

type Manager

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

Output manager main structure

func NewManager

func NewManager(maxStreams int) *Manager

func (*Manager) AddProgressBarToStream added in v0.6.11

func (m *Manager) AddProgressBarToStream(name string, percentage float64, text string)

func (*Manager) AddStreamLine

func (m *Manager) AddStreamLine(name string, line string)

func (*Manager) ClearAll added in v0.6.7

func (m *Manager) ClearAll()

func (*Manager) ClearFunction

func (m *Manager) ClearFunction(name string)

func (*Manager) ClearLines

func (m *Manager) ClearLines(n int)

func (*Manager) Complete

func (m *Manager) Complete(name string)

func (*Manager) GetStatus

func (m *Manager) GetStatus(name string) string

func (*Manager) GetStatusIndicator added in v0.6.11

func (m *Manager) GetStatusIndicator(status string) string

func (*Manager) Pause

func (m *Manager) Pause()

func (*Manager) Register

func (m *Manager) Register(name string)

func (*Manager) RegisterFunctionTable added in v0.6.11

func (m *Manager) RegisterFunctionTable(funcName string, name string, headers []string) *Table

Adds a function-specific table

func (*Manager) RegisterTable

func (m *Manager) RegisterTable(name string, headers []string) *Table

Add a global table

func (*Manager) ReportError

func (m *Manager) ReportError(name string, err error)

func (*Manager) Resume

func (m *Manager) Resume()

func (*Manager) SetMessage

func (m *Manager) SetMessage(name, message string)

func (*Manager) SetStatus

func (m *Manager) SetStatus(name, status string)

func (*Manager) SetUnlimitedOutput

func (m *Manager) SetUnlimitedOutput(unlimited bool)

func (*Manager) SetUpdateInterval

func (m *Manager) SetUpdateInterval(interval time.Duration)

func (*Manager) ShowSummary

func (m *Manager) ShowSummary()

func (*Manager) StartDisplay

func (m *Manager) StartDisplay()

func (*Manager) StopDisplay

func (m *Manager) StopDisplay()

func (*Manager) UpdateStreamOutput

func (m *Manager) UpdateStreamOutput(name string, output []string)

type Table

type Table struct {
	Headers []string
	Rows    [][]string
	// contains filtered or unexported fields
}

func NewTable

func NewTable(headers []string) *Table

func (*Table) FormatTable

func (t *Table) FormatTable(useMarkdown bool) string

func (*Table) PrintTable

func (t *Table) PrintTable(useMarkdown bool)

func (*Table) ReconcileRows added in v0.6.11

func (t *Table) ReconcileRows()

func (*Table) WriteMarkdownTableToFile

func (t *Table) WriteMarkdownTableToFile(outputPath string) error

Jump to

Keyboard shortcuts

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