tui

package
v0.0.0-...-c9ec783 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package tui contains types and logic for the interactive TUI part of Gopen.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartTUI

func StartTUI(cfg config.C) *tea.Program

StartTUI is the entry point for the interactive TUI which spawns the bubbletea program.

Types

type Model

type Model struct {
	Config   config.C
	Selected string
	// contains filtered or unexported fields
}

Model implements the tea.Model interface to be used as the model part of the bubbletea program and includes fields that hold the program state.

Note that the fields `Config` and `Selected` are exported because the are used by the main package.

func (Model) Init

func (m Model) Init() tea.Cmd

Init is one of the tea.Model interface methods but not used by the TUI.

func (Model) Update

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

Update is one of the tea.Model interface methods. It triggers updates to the model and its state on keypresses.

func (Model) View

func (m Model) View() string

View is one of the tea.Model interface methods. It includes the rendering logic.

Jump to

Keyboard shortcuts

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