shared

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTextInputs

func GetTextInputs() []textinput.Model

GetTextInputs returns two textinput.Model. The first model is meant for a URL. The second model is meant for a token.

func NewList

func NewList(items []list.Item, delegate list.ItemDelegate, title string) list.Model

NewList returns a list given items, delegate and title. Furthermore, the status bar and filtering are disabled. It also sets styles for the title, pagination and help.

func RenderInputFields

func RenderInputFields(inputs []textinput.Model, apiDetails string, focusIndex int, width int, height int) string

RenderInputFields renders the input fields created by GetTextInputs.

func RenderList

func RenderList(list list.Model) string

RenderList renders a list in the list style with a max width set by list.Width().

Types

type DetailItem

type DetailItem struct {
	Username  string
	TokenName string
}

DetailItem is a list.Item and contains the user and token name of a remote.

func (DetailItem) FilterValue

func (d DetailItem) FilterValue() string

FilterValue is required for DetailItem to be a list.Item.

type DetailsItemDelegate

type DetailsItemDelegate struct{}

DetailsItemDelegate is a list.ItemDelegate for DetailItem.

func (DetailsItemDelegate) Height

func (d DetailsItemDelegate) Height() int

Height is required for selectItemDelegate to be a list.ItemDelegate.

func (DetailsItemDelegate) Render

func (d DetailsItemDelegate) Render(w io.Writer, m list.Model, index int, item list.Item)

Render is required for selectItemDelegate to be a list.ItemDelegate.

func (DetailsItemDelegate) Spacing

func (d DetailsItemDelegate) Spacing() int

Spacing is required for selectItemDelegate to be a list.ItemDelegate.

func (DetailsItemDelegate) Update

func (d DetailsItemDelegate) Update(_ tea.Msg, _ *list.Model) tea.Cmd

Update is required for selectItemDelegate to be a list.ItemDelegate.

type ItemDelegate

type ItemDelegate struct{}

ItemDelegate is a list.ItemDelegate for ListItem.

func (ItemDelegate) Height

func (d ItemDelegate) Height() int

Height is required for selectItemDelegate to be a list.ItemDelegate.

func (ItemDelegate) Render

func (d ItemDelegate) Render(w io.Writer, m list.Model, index int, item list.Item)

Render is required for selectItemDelegate to be a list.ItemDelegate.

func (ItemDelegate) Spacing

func (d ItemDelegate) Spacing() int

Spacing is required for selectItemDelegate to be a list.ItemDelegate.

func (ItemDelegate) Update

func (d ItemDelegate) Update(_ tea.Msg, _ *list.Model) tea.Cmd

Update is required for selectItemDelegate to be a list.ItemDelegate.

type ListItem

type ListItem struct {
	Remote *configuration.Remote
}

ListItem is a list.Item and contains a *configuration.Remote.

func (ListItem) FilterValue

func (i ListItem) FilterValue() string

FilterValue is required for ListItem to be a list.Item.

Jump to

Keyboard shortcuts

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