debug

package
v0.1.35 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package debug provides debugging utilities for Kafui. This package is only included in debug builds. This is a stub implementation for production builds.

Index

Constants

View Source
const KeycastEnabled = false

KeycastEnabled reports whether this build renders the strip.

Variables

This section is empty.

Functions

func Capture

func Capture(view string, options CaptureOptions) (string, error)

Capture is a stub implementation that returns an error in production builds

func CaptureWithFormat

func CaptureWithFormat(view string, options CaptureOptions) (string, error)

CaptureWithFormat is a stub implementation for production builds

func StripANSICodes

func StripANSICodes(input string) string

StripANSICodes removes ANSI escape codes from a string

Types

type CaptureOptions

type CaptureOptions struct {
	// Format is the output format (plain text or ANSI)
	Format ScreenshotFormat

	// Redact enables sensitive data redaction
	Redact bool

	// OutputDir is the directory to save screenshots (defaults to temp dir)
	OutputDir string

	// Version is the application version
	Version string

	// CurrentPage is the current page name
	CurrentPage string

	// PageContext provides additional context about the current page
	PageContext string

	// TerminalWidth is the terminal width
	TerminalWidth int

	// TerminalHeight is the terminal height
	TerminalHeight int
}

CaptureOptions holds options for screenshot capture

type Keycast added in v0.1.35

type Keycast struct{}

Keycast is the production no-op. The strip is a debugging and demo-recording aid, so it costs nothing in a release build.

func (*Keycast) Record added in v0.1.35

func (k *Keycast) Record(key, action string)

Record does nothing in a production build.

func (*Keycast) View added in v0.1.35

func (k *Keycast) View() string

View returns nothing in a production build.

type ScreenshotFormat

type ScreenshotFormat int

ScreenshotFormat represents the output format for screenshots

const (
	// FormatPlainText outputs plain text without ANSI codes
	FormatPlainText ScreenshotFormat = iota
	// FormatANSI outputs text with ANSI color codes preserved
	FormatANSI
)

Jump to

Keyboard shortcuts

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