menu

package
v0.0.0-...-cd40d76 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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

Menu is a slice of sessions. It also stores selected session

func New

func New(screen tcell.Screen, client *client.Client) *Menu

New returns an empty Menu

func (m *Menu) Append(item *sessioninfo.SessionInfo)

Append appends item to Menu

func (m *Menu) Current() *sessioninfo.SessionInfo

Current returns currently selected item

func (m *Menu) DeleteByID(id uuid.UUID) bool

DeleteByID deletes item with correspondind ID from slice

func (m *Menu) Down()

Down moves selected ptr up if possible

func (m *Menu) Get(idx int) (*sessioninfo.SessionInfo, bool)

Get returns item from Menu with given index

func (m *Menu) Init() error
func (m *Menu) Items() []*sessioninfo.SessionInfo

Items returns a slice of items in Menu

func (m *Menu) Len() int

Len returns length of Menu

func (m *Menu) Render()

Render renders the menu

func (m *Menu) RunTillExit()
func (m *Menu) Up()

Up moves selected ptr down if possible

Jump to

Keyboard shortcuts

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