tui

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColorizeStatus

func ColorizeStatus(status int) string

ColorizeStatus returns a styled status code string

func FormatEventLog

func FormatEventLog(event EventInfo, dashboardURL, consoleURL, projectMode string) string

FormatEventLog formats an event into a log line matching the current style

Types

type Config

type Config struct {
	DeviceName       string
	APIKey           string
	APIBaseURL       string
	DashboardBaseURL string
	ConsoleBaseURL   string
	ProjectMode      string
	ProjectID        string
	GuestURL         string
	TargetURL        *url.URL
	Sources          []*hookdecksdk.Source
	Connections      []*hookdecksdk.Connection
	Filters          interface{} // Session filters (stored as interface{} to avoid circular dependency)
}

Config holds configuration for the TUI

type ConnectedMsg

type ConnectedMsg struct{}

ConnectedMsg is sent when websocket connects

type ConnectingMsg

type ConnectingMsg struct{}

ConnectingMsg is sent when starting to connect

type DisconnectedMsg

type DisconnectedMsg struct{}

DisconnectedMsg is sent when websocket disconnects

type EventInfo

type EventInfo struct {
	ID               string // Event ID from Hookdeck
	AttemptID        string // Attempt ID (unique per retry)
	Status           int
	Success          bool
	Time             time.Time
	Data             *websocket.Attempt
	LogLine          string
	ResponseStatus   int
	ResponseHeaders  map[string][]string
	ResponseBody     string
	ResponseDuration time.Duration
}

EventInfo represents a single event with all its data

type Model

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

Model is the Bubble Tea model for the interactive TUI

func NewModel

func NewModel(cfg *Config) Model

NewModel creates a new TUI model

func (*Model) AddEvent

func (m *Model) AddEvent(event EventInfo)

AddEvent adds a new event to the history

func (*Model) GetSelectedEvent

func (m *Model) GetSelectedEvent() *EventInfo

GetSelectedEvent returns the currently selected event

func (Model) Init

func (m Model) Init() tea.Cmd

Init initializes the model (required by Bubble Tea)

func (*Model) Navigate

func (m *Model) Navigate(direction int) bool

Navigate moves selection up or down (all events are navigable)

func (Model) Update

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

Update handles all events in the Bubble Tea event loop

func (*Model) UpdateEvent

func (m *Model) UpdateEvent(update UpdateEventMsg)

UpdateEvent updates an existing event by EventID + Time, or creates a new one if not found

func (Model) View

func (m Model) View() string

View renders the TUI with fixed header and scrollable event list

type NewEventMsg

type NewEventMsg struct {
	Event EventInfo
}

NewEventMsg is sent when a new webhook event arrives

type ServerHealthMsg added in v1.5.0

type ServerHealthMsg struct {
	Healthy bool
	Error   error
}

ServerHealthMsg is sent when server health status changes

type TickWaitingMsg

type TickWaitingMsg struct{}

TickWaitingMsg is sent to animate waiting indicator

type UpdateEventMsg

type UpdateEventMsg struct {
	EventID          string             // Event ID from Hookdeck
	AttemptID        string             // Attempt ID (unique per connection)
	Time             time.Time          // Event time
	Data             *websocket.Attempt // Full attempt data
	Status           int
	Success          bool
	LogLine          string
	ResponseStatus   int
	ResponseHeaders  map[string][]string
	ResponseBody     string
	ResponseDuration time.Duration
}

UpdateEventMsg is sent when an existing event gets a response

Jump to

Keyboard shortcuts

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