tui

package
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenNotificationsCmd

func ListenNotificationsCmd(ctx context.Context, notifCh <-chan storage.Notification, processor *xsync.NotificationProcessor, sseClient *sse.Client) tea.Cmd

ListenNotificationsCmd reads from the notification channel, processes the notification via the NotificationProcessor, and returns a NotificationMsg. This command should be re-invoked after each message to continue listening. On successful processing, acknowledges the notification to prevent reprocessing.

func StartSSECmd

func StartSSECmd(ctx context.Context, client *sse.Client, notifCh chan<- storage.Notification) tea.Cmd

StartSSECmd launches a goroutine that connects to the SSE server and pushes notifications to the provided channel. The channel bridges the blocking SSE client with bubbletea's message system.

Types

type Deps

type Deps struct {
	Ctx              context.Context
	Cancel           context.CancelFunc
	Logger           *slog.Logger
	TokenChecker     oauth.TokenChecker
	TokenSource      oauth.TokenSource
	AuthFlow         oauth.Flow
	CacheService     cache.CacheService
	SSEClient        *sse.Client
	NotifProcessor   *xsync.NotificationProcessor
	NotificationChan chan storage.Notification
}

type Model

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

func New

func New(deps Deps) Model

func (*Model) Init

func (m *Model) Init() tea.Cmd

func (*Model) Update

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

func (*Model) View

func (m *Model) View() tea.View

type NotificationMsg

type NotificationMsg struct {
	Notification storage.Notification
	Result       xsync.ProcessResult
}

type SSEConnectedMsg

type SSEConnectedMsg struct{}

type SSEDisconnectedMsg

type SSEDisconnectedMsg struct {
	Err error
}

Directories

Path Synopsis
components

Jump to

Keyboard shortcuts

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