tab

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTab

func NewTab(title string, tabType Type) tea.Cmd

NewTab returns a tea.Cmd which sends a message to the main model to create a new tab

Types

type Help

type Help []KeyBind

Help is strcure containing the keys and their descriptions for a given tab

type KeyBind

type KeyBind struct {
	Key         string
	Description string
}

KeyBind is a struct containing the description of a tab and the keys that are used to interact with it

type NewTabMessage

type NewTabMessage struct {
	Title string
	Type  Type
}

NewTabMessage is a tea.Msg that signals that a new tab should be created

type Tab

type Tab interface {
	// general fields
	Title() string
	Type() Type
	Help() Help

	// bubbletea methods
	Init() tea.Cmd
	Update(msg tea.Msg) (Tab, tea.Cmd)
	View() string
}

Tab is an interface outlining the methods that a tab should implement a bubbletea models' methods and also some more

type Type

type Type int
const (
	Welcome Type = iota
	Feed
	Category
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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