tree

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

type Group struct {
	deadlock.RWMutex
	// contains filtered or unexported fields
}

func (Group) Binds

func (m Group) Binds() *bind.BindScope

func (*Group) Children

func (g *Group) Children() []Node

func (Group) Id

func (m Group) Id() int32

func (*Group) Leaves added in v0.1.6

func (g *Group) Leaves() []Node

func (Group) Name

func (m Group) Name() string

func (*Group) NewGroup

func (g *Group) NewGroup() *Group

func (*Group) NewPane

func (g *Group) NewPane(ctx context.Context, screen mux.Screen) *Pane

func (Group) Params added in v0.1.6

func (m Group) Params() *params.Parameters

func (Group) SetName

func (m Group) SetName(name string)

type Node

type Node interface {
	Id() NodeID
	Name() string
	Params() *params.Parameters
	SetName(string)
	Binds() *bind.BindScope
}

type NodeEvent added in v0.1.6

type NodeEvent struct {
	Id    NodeID
	Event events.Msg
}

type NodeID

type NodeID = int32

type Pane

type Pane struct {
	util.Lifetime
	// contains filtered or unexported fields
}

func (Pane) Binds

func (m Pane) Binds() *bind.BindScope

func (Pane) Id

func (m Pane) Id() int32

func (Pane) Name

func (m Pane) Name() string

func (Pane) Params added in v0.1.6

func (m Pane) Params() *params.Parameters

func (*Pane) Screen

func (p *Pane) Screen() mux.Screen

func (Pane) SetName

func (m Pane) SetName(name string)

type Tree

type Tree struct {
	deadlock.RWMutex
	*mux.UpdatePublisher
	// contains filtered or unexported fields
}

func NewTree

func NewTree(options ...TreeOption) *Tree

func (*Tree) GroupById

func (t *Tree) GroupById(id NodeID) (*Group, bool)

func (*Tree) Leaves

func (t *Tree) Leaves() []Node

func (*Tree) NodeById

func (t *Tree) NodeById(id NodeID) (Node, bool)

func (*Tree) PaneById

func (t *Tree) PaneById(id NodeID) (*Pane, bool)

func (*Tree) PathTo

func (t *Tree) PathTo(node Node) []Node

Get the path from the root node to the given node.

func (*Tree) RemoveNode added in v0.1.1

func (t *Tree) RemoveNode(id NodeID) error

func (*Tree) Root

func (t *Tree) Root() *Group

type TreeOption added in v0.1.6

type TreeOption func(*Tree)

func WithParams added in v0.1.6

func WithParams(p *params.Parameters) TreeOption

Jump to

Keyboard shortcuts

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