pages

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: MIT Imports: 16 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
}

App is like a stack of papers (pages). The top page is what you see. Think of it like browser tabs or a deck of cards.

func NewApp

func NewApp() App

Create new empty app

func (App) Init

func (a App) Init() tea.Cmd

Called when app starts - we wait for window size before creating pages

func (App) Update

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

Handles all events/messages in the app

func (App) View

func (a App) View() string

Shows current (top) page

type AuthErrorMsg

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

type AuthSuccessMsg

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

type ConnectPage

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

func NewConnectPage

func NewConnectPage() ConnectPage

func (ConnectPage) Init

func (p ConnectPage) Init() tea.Cmd

func (ConnectPage) Update

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

func (ConnectPage) View

func (p ConnectPage) View() string

type DashboardPage

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

func NewDashboard

func NewDashboard() DashboardPage

func (DashboardPage) Init

func (p DashboardPage) Init() tea.Cmd

func (DashboardPage) Update

func (p DashboardPage) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (DashboardPage) View

func (p DashboardPage) View() string

type PopPageMsg

type PopPageMsg struct{}

Message to remove the top page and go back to previous Example: Closing settings to go back to dashboard

type PushPageMsg

type PushPageMsg struct {
	Page tea.Model
}

Message to add a new page on top of the stack Example: Going from login to dashboard, or opening settings

Jump to

Keyboard shortcuts

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