tui

package
v8.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

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

Model encapsulates state that updates a view.

func NewModel

func NewModel(
	querySvc QueryService,
	databasePath string,
	schemaVersion string,
	schemaDate time.Time,
	testCases []blockdb.TestCaseResult,
) *Model

NewModel returns a valid *Model.

func (*Model) RootView

func (m *Model) RootView() *tview.Flex

RootView is a root view for a tview.Application.

func (*Model) Update

func (m *Model) Update(ctx context.Context) func(event *tcell.EventKey) *tcell.EventKey

Update should be the argument for *(tview.Application).SetInputCapture. The Model potentially updates view state based on the event. Update must be called from the main goroutine. Otherwise, view updates will not render or cause data races. Per tview documentation, return nil to stop event propagation.

type QueryService

type QueryService interface {
	CosmosMessages(ctx context.Context, chainPkey int64) ([]blockdb.CosmosMessageResult, error)
	Transactions(ctx context.Context, chainPkey int64) ([]blockdb.TxResult, error)
}

QueryService fetches data from a database.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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