termfx

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package termfx provides the animation registry and terminal helpers used by gotermfx. Animations implement Animation and register themselves via Register so the CLI can discover and run them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSize

func GetSize() (cols, rows int)

GetSize returns the current terminal size in columns and rows. When the size cannot be determined it falls back to 80x24.

func IsOnce

func IsOnce(ctx context.Context) bool

IsOnce reports whether ctx was created with WithOnce.

func List

func List() []string

List returns the registered animation names in registration order.

func Register

func Register(name string, a Animation)

Register adds an animation to the global registry under the given name.

func WithOnce

func WithOnce(ctx context.Context) context.Context

WithOnce returns a child context that signals animations to exit after one cycle.

Types

type Animation

type Animation interface {
	Run(ctx context.Context)
}

Animation is the interface every animation must implement. Run should block until ctx is cancelled or the animation finishes in once mode.

func Get

func Get(i int) Animation

Get returns the animation at index i. Panics if i is out of range.

Jump to

Keyboard shortcuts

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