tui

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

func NewApp

func NewApp(cfg AppConfig) *App

NewApp creates a TUI application from the given config.

func (*App) Init

func (a *App) Init() tea.Cmd

func (*App) Update

func (a *App) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*App) View

func (a *App) View() tea.View

type AppConfig added in v0.1.5

type AppConfig struct {
	Store        FlowReader
	Proxy        ProxyInfo
	CATrusted    bool
	Scripts      ScriptManager
	Throttle     ThrottleController
	MapLocal     MapLocalManager
	MapLocalFile string
}

AppConfig holds all dependencies for the TUI application.

type FlowReader

type FlowReader interface {
	List(filter store.Filter, offset, limit int) ([]store.FlowMeta, int)
	Get(id store.FlowID) (*store.FlowMeta, *store.FlowData, error)
}

FlowReader is the read-only port the TUI uses to access captured flows.

type MapLocalManager added in v0.1.5

type MapLocalManager interface {
	Rules() []maplocal.Rule
	AddRule(r maplocal.Rule)
	RemoveRule(index int)
	SaveToFile(path string) error
}

MapLocalManager exposes map-local rule management to the TUI.

type ProxyInfo

type ProxyInfo interface {
	Addr() string
}

ProxyInfo exposes proxy status to the TUI (listen address, etc.).

type ScriptManager added in v0.1.5

type ScriptManager interface {
	Scripts() []scripting.ScriptInfo
	Toggle(filePath string) error
	Delete(filePath string) error
	CreateNew() (string, error)
	ScriptDir() string
	Reload()
}

ScriptManager exposes script operations to the TUI.

type ThrottleController added in v0.1.5

type ThrottleController interface {
	SetThrottle(bps int64, latency time.Duration)
	GetThrottleBPS() int64
	GetThrottleLatency() time.Duration
}

ThrottleController manages bandwidth throttling at runtime.

type TickMsg added in v0.1.5

type TickMsg time.Time

TickMsg triggers a flow list refresh in the TUI.

Jump to

Keyboard shortcuts

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