page

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PAGE_HOME     = iota
	PAGE_DATABASE = iota
	PAGE_TABLE    = iota
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchedNewRowsMsg

type BatchedNewRowsMsg struct {
	Msgs []NewRowsMsg
}

type ChangePageMsg

type ChangePageMsg struct {
	NewPageId    int  // Id of page to switch to
	FetchData    bool // If true, clears and re(fetches) data on new page
	PageMetadata interface{}
}

type Model

type Model struct {
	Id     int
	Ctx    context.ProgramContext
	Tabs   tabs.Model
	Tables []table.Model
}

Logical section with a set of tables/tabs

func (*Model) AppendRows

func (m *Model) AppendRows(tabId int, rows []table.Row)

func (*Model) ClearData

func (m *Model) ClearData()

func (*Model) ClearRows

func (m *Model) ClearRows(tabId int)

func (*Model) FetchDataCmd

func (m *Model) FetchDataCmd(client data.Client) tea.Cmd

func (*Model) FirstItem

func (m *Model) FirstItem() int

func (*Model) Init

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

func (*Model) InspectFieldCmd

func (m *Model) InspectFieldCmd(client data.Client) tea.Cmd

func (*Model) LastItem

func (m *Model) LastItem() int

func (*Model) NextCol

func (m *Model) NextCol() int

func (*Model) NextItem

func (m *Model) NextItem() int

func (*Model) NextTab

func (m *Model) NextTab() int

func (*Model) PrevCol

func (m *Model) PrevCol() int

func (*Model) PrevItem

func (m *Model) PrevItem() int

func (*Model) PrevTab

func (m *Model) PrevTab() int

func (*Model) SetPageMetadata

func (m *Model) SetPageMetadata(metadata interface{})

func (*Model) StartSearch

func (m *Model) StartSearch()

func (*Model) StopSearch

func (m *Model) StopSearch()

func (*Model) UpdateProgramContext

func (m *Model) UpdateProgramContext(ctx *context.ProgramContext)

func (*Model) UpdateSearch

func (m *Model) UpdateSearch(msg tea.Msg) tea.Cmd

func (*Model) View

func (m *Model) View() string

type NewRowsMsg

type NewRowsMsg struct {
	PageId    int
	TabId     int
	Rows      []table.Row
	NextCmd   tea.Cmd
	Overwrite bool
}

type Page

type Page interface {
	Init() tea.Cmd
	View() string
	UpdateProgramContext(ctx *context.ProgramContext)
	UpdateSearch(msg tea.Msg) tea.Cmd
	NextTab() int
	PrevTab() int
	NextItem() int
	PrevItem() int
	FirstItem() int
	LastItem() int
	NextCol() int
	PrevCol() int
	StartSearch()
	StopSearch()
	FetchDataCmd(client data.Client) tea.Cmd
	ClearData()
	AppendRows(tabId int, rows []table.Row)
	ClearRows(tabId int)
	InspectFieldCmd(client data.Client) tea.Cmd
	SetPageMetadata(metadata interface{})
}

Jump to

Keyboard shortcuts

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