clientslist

package
v0.0.0-...-4f3a07d Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultKeyMap = KeyMap{
	CursorUp:   key.NewBinding(key.WithKeys("up", "k"), key.WithHelp("↑/k", "up")),
	CursorDown: key.NewBinding(key.WithKeys("down", "j"), key.WithHelp("↓/j", "down")),
	Quit:       key.NewBinding(key.WithKeys("q", "esc"), key.WithHelp("q/esc", "quit")),
	Help:       key.NewBinding(key.WithKeys("?"), key.WithHelp("?", "close help")),
	Select:     key.NewBinding(key.WithKeys("enter"), key.WithHelp("enter", "select client")),
	Reload:     key.NewBinding(key.WithKeys("r"), key.WithHelp("r", "reload list")),
}

Functions

This section is empty.

Types

type ClientsItem

type ClientsItem interface {
	fmt.Stringer
	// just to fulfill the list.Item interface
	FilterValue() string
	// Return the title of the client
	Title() string
	// Whether the client is available
	Available() bool
	// Some stats about the client. Will be displayed next to each other separated by a dot
	Stats() []string
}

type DefaultItemStyles

type DefaultItemStyles struct {
	DefaultClient  lipgloss.Style
	SelectedSonarr lipgloss.Style
	SelectedRadarr lipgloss.Style
}

type KeyMap

type KeyMap struct {
	CursorUp   key.Binding
	CursorDown key.Binding
	Quit       key.Binding
	Help       key.Binding
	Select     key.Binding
	Reload     key.Binding
}

func (KeyMap) FullHelp

func (k KeyMap) FullHelp() [][]key.Binding

type Model

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

func New

func New(client *core.Client) Model

func (Model) Help

func (m Model) Help() [][]key.Binding

func (Model) Index

func (m Model) Index() int

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) SelectedItem

func (m Model) SelectedItem() list.Item

func (*Model) SetSize

func (m *Model) SetSize(width, height int)

func (Model) Update

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

func (Model) View

func (m Model) View() string

func (Model) VisibleItems

func (m Model) VisibleItems() []list.Item

Jump to

Keyboard shortcuts

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