Help us shape the future of Go! Take the 2026 Go Developer Survey

visual

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateLiveUploadDisplay

func CreateLiveUploadDisplay() func()

CreateLiveUploadDisplay creates a live dashboard for multiple uploads

func DisableAnimations

func DisableAnimations()

DisableAnimations suppresses all visual output and sleeps.

func EnableAnimations

func EnableAnimations()

EnableAnimations re-enables visual output.

func IsQuiet

func IsQuiet() bool

IsQuiet returns whether animations are suppressed.

func RandomAnimation

func RandomAnimation()

Random animations for fun

func SetTheme

func SetTheme(theme *VisualTheme)

SetTheme changes the visual theme

func ShowDashboard

func ShowDashboard(title string, metrics map[string]interface{})

ShowDashboard displays a live dashboard

func ShowError

func ShowError(message string)

ShowError displays an error message with animation

func ShowProgress

func ShowProgress(current, total int64, message string)

ShowProgress displays an animated progress bar

func ShowR2UploadProgress

func ShowR2UploadProgress(fileName, bucket, objectKey string, size int64)

Global convenience function for showing upload progress

func ShowResult

func ShowResult(title string, details map[string]interface{})

ShowResult displays formatted results

func ShowSpinner

func ShowSpinner(message string, duration time.Duration)

ShowSpinner displays an animated spinner

func ShowStartupAnimation

func ShowStartupAnimation()

ShowStartupAnimation displays the default startup animation

func ShowSuccess

func ShowSuccess(message string)

ShowSuccess displays a success message with animation

Types

type AnimationType

type AnimationType int

Animation types

const (
	AnimationTypeSpinner AnimationType = iota
	AnimationTypeDots
	AnimationTypePulse
	AnimationTypeWave
	AnimationTypeProgress
	AnimationTypeRainbow
	AnimationTypeGlow
)

type R2ProgressModel

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

R2ProgressModel implements the Bubble Tea model for rich progress display

func NewR2ProgressModel

func NewR2ProgressModel(rp *R2UploadProgress) *R2ProgressModel

func (*R2ProgressModel) Init

func (m *R2ProgressModel) Init() tea.Cmd

func (*R2ProgressModel) Update

func (m *R2ProgressModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*R2ProgressModel) View

func (m *R2ProgressModel) View() string

type R2ProgressReader

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

R2ProgressReader wraps an io.Reader to show upload progress

func NewR2ProgressReader

func NewR2ProgressReader(reader io.Reader, rp *R2UploadProgress, upload *R2UploadState) *R2ProgressReader

NewR2ProgressReader creates a new progress reader for R2 uploads

func (*R2ProgressReader) Read

func (rpr *R2ProgressReader) Read(p []byte) (n int, err error)

Read implements io.Reader while tracking progress

type R2UploadProgress

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

R2UploadProgress tracks multiple R2 uploads with rich visual feedback

func NewR2UploadProgress

func NewR2UploadProgress() *R2UploadProgress

NewR2UploadProgress creates a new R2 upload progress tracker

func (*R2UploadProgress) AddUpload

func (rup *R2UploadProgress) AddUpload(fileName, bucket, objectKey string, totalSize int64) *R2UploadState

AddUpload adds a new upload to track

func (*R2UploadProgress) CancelUpload

func (rup *R2UploadProgress) CancelUpload(upload *R2UploadState)

CancelUpload cancels an upload

func (*R2UploadProgress) CompleteUpload

func (rup *R2UploadProgress) CompleteUpload(upload *R2UploadState)

CompleteUpload marks an upload as completed

func (*R2UploadProgress) FailUpload

func (rup *R2UploadProgress) FailUpload(upload *R2UploadState, err error)

FailUpload marks an upload as failed

func (*R2UploadProgress) GetActiveUpload

func (rup *R2UploadProgress) GetActiveUpload() *R2UploadState

GetActiveUpload returns the currently active upload

func (*R2UploadProgress) ShowSimpleProgress

func (rup *R2UploadProgress) ShowSimpleProgress()

ShowSimpleProgress displays a simple progress bar in terminal

func (*R2UploadProgress) StartLiveDisplay

func (rup *R2UploadProgress) StartLiveDisplay()

StartLiveDisplay starts the live progress display

func (*R2UploadProgress) StartUpload

func (rup *R2UploadProgress) StartUpload(upload *R2UploadState)

StartUpload marks an upload as started

func (*R2UploadProgress) StopLiveDisplay

func (rup *R2UploadProgress) StopLiveDisplay()

StopLiveDisplay stops the live progress display

func (*R2UploadProgress) UpdateProgress

func (rup *R2UploadProgress) UpdateProgress(upload *R2UploadState, uploadedBytes int64, speed float64)

UpdateProgress updates the progress of an active upload

type R2UploadState

type R2UploadState struct {
	FileName       string
	Bucket         string
	ObjectKey      string
	TotalSize      int64
	UploadedBytes  int64
	Speed          float64
	ETA            time.Duration
	StartTime      time.Time
	LastUpdate     time.Time
	Status         UploadStatus
	Error          error
	Progress       float64
	PartsCompleted int
	TotalParts     int
	UploadID       string
}

R2UploadState represents the state of an R2 upload

type TerminalEffects

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

TerminalEffects provides advanced terminal animations

func NewTerminalEffects

func NewTerminalEffects(theme *VisualTheme) *TerminalEffects

NewTerminalEffects creates a new terminal effects manager

func (*TerminalEffects) AnimatedProgress

func (te *TerminalEffects) AnimatedProgress(current, total int64, message string)

ProgressBar creates an animated progress bar with custom styling

func (*TerminalEffects) AnimatedSpinner

func (te *TerminalEffects) AnimatedSpinner(message string, duration time.Duration)

AnimatedSpinner creates an animated spinner with custom styling

func (*TerminalEffects) AnimatedTypewriter

func (te *TerminalEffects) AnimatedTypewriter(text string, speed time.Duration)

AnimatedTypewriter creates typewriter effect

func (*TerminalEffects) ErrorAnimation

func (te *TerminalEffects) ErrorAnimation(message string)

ErrorAnimation displays an error with animation

func (*TerminalEffects) GlowingText

func (te *TerminalEffects) GlowingText(text string)

GlowingText creates a glowing text effect

func (*TerminalEffects) LiveDashboard

func (te *TerminalEffects) LiveDashboard(title string, metrics map[string]interface{})

LiveDashboard creates a real-time dashboard display

func (*TerminalEffects) PulseAnimation

func (te *TerminalEffects) PulseAnimation(message string, cycles int)

PulseAnimation creates a pulsing effect

func (*TerminalEffects) RainbowText

func (te *TerminalEffects) RainbowText(text string)

RainbowText creates rainbow-colored text

func (*TerminalEffects) ShowResult

func (te *TerminalEffects) ShowResult(title string, details map[string]interface{})

ShowResult displays formatted operation results

func (*TerminalEffects) ShowStartupAnimation

func (te *TerminalEffects) ShowStartupAnimation()

ShowStartupAnimation displays a beautiful startup animation

func (*TerminalEffects) SuccessAnimation

func (te *TerminalEffects) SuccessAnimation(message string)

SuccessAnimation displays a beautiful success animation

func (*TerminalEffects) WaveAnimation

func (te *TerminalEffects) WaveAnimation(text string)

WaveAnimation creates a wave effect on text

type UploadStatus

type UploadStatus int

UploadStatus represents the current status

const (
	StatusQueued UploadStatus = iota
	StatusConnecting
	StatusUploading
	StatusPaused
	StatusCompleted
	StatusFailed
	StatusCancelled
)

func (UploadStatus) String

func (s UploadStatus) String() string

String returns the string representation of the status

type VisualTheme

type VisualTheme struct {
	Primary    lipgloss.Color
	Secondary  lipgloss.Color
	Success    lipgloss.Color
	Warning    lipgloss.Color
	Error      lipgloss.Color
	Info       lipgloss.Color
	Background lipgloss.Color
	Foreground lipgloss.Color
}

VisualTheme defines color schemes and styles

func DarkTheme

func DarkTheme() *VisualTheme

DarkTheme returns a dark professional theme

func DefaultTheme

func DefaultTheme() *VisualTheme

DefaultTheme returns a professional color theme

Jump to

Keyboard shortcuts

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