models

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Children

type Children []*Node

func (Children) At

func (c Children) At(index int) tree.Node

func (Children) Length

func (c Children) Length() int

type Node

type Node struct {
	Name   string
	Detail pcie.Details
	Parent *Node
	// Idx is the index of Node in Parent's Children field.
	Idx int
	// contains filtered or unexported fields
}

func NewNode

func NewNode(name string, detail pcie.Details, parent *Node, model *TreeModel) *Node

func (*Node) AddChild

func (n *Node) AddChild(name string, detail pcie.Details) *Node

func (Node) Children

func (n Node) Children() tree.Children

func (*Node) GetDetail

func (n *Node) GetDetail() string

func (Node) Hidden

func (n Node) Hidden() bool

func (*Node) RefreshDetail

func (n *Node) RefreshDetail() tea.Cmd

func (Node) String

func (n Node) String() string

func (Node) Value

func (n Node) Value() string

type RootModel

type RootModel struct {
	Tree *TreeModel
	// contains filtered or unexported fields
}

func NewRootModel

func NewRootModel() (*RootModel, error)

func (*RootModel) Init

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

func (*RootModel) Update

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

func (*RootModel) View

func (m *RootModel) View() string

type TreeKeymap

type TreeKeymap struct {
	Left  key.Binding
	Right key.Binding
	Up    key.Binding
	Down  key.Binding
}

type TreeModel

type TreeModel struct {
	Root    *Node
	CurNode *Node
	Keymap  TreeKeymap
}

func NewTreeModel

func NewTreeModel() *TreeModel

func (*TreeModel) Init

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

func (*TreeModel) Update

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

func (*TreeModel) View

func (m *TreeModel) View() string

Jump to

Keyboard shortcuts

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