ui

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewChat

func NewChat(myName, peerName string, send SendFn) *tea.Program

NewChat creates and starts the Bubbletea chat program.

Types

type ConfirmMsg

type ConfirmMsg struct {
	Text string // e.g. "alice wants to send report.pdf (2.3 MB)"
}

ConfirmMsg puts the UI into confirmation mode for an incoming file transfer.

type ErrMsg

type ErrMsg struct{ Err error }

ErrMsg signals a fatal error.

type IncomingMsg

type IncomingMsg struct {
	From string
	Body string
}

IncomingMsg is a Bubbletea message for a message received from the peer.

type Message

type Message struct {
	From string
	Body string
	At   time.Time
}

Message represents a single chat entry.

type PeerRenameMsg

type PeerRenameMsg struct{ Name string }

PeerRenameMsg updates the peer's display name when they use /rename.

type ProgressMsg

type ProgressMsg struct {
	Text string
}

ProgressMsg updates the live transfer progress bar. Empty Text clears it.

type RenameMsg

type RenameMsg struct{ Name string }

RenameMsg updates the local user's display name mid-session.

type SendFn

type SendFn func(msg string) error

SendFn is called by the UI when the user submits a message.

type SystemMsg

type SystemMsg struct {
	Text string
}

SystemMsg is a Bubbletea message for a system/status notification.

Jump to

Keyboard shortcuts

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