search

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloseSearchMsg

type CloseSearchMsg struct{}

type KeyMap

type KeyMap struct {
	// Keybindings used when setting a filter.
	CancelWhileSearching key.Binding
	AcceptWhileSearching key.Binding

	OpenEntry   key.Binding
	SelectEntry key.Binding
	Search      key.Binding
	CloseSearch key.Binding
}

func DefaultKeyMap

func DefaultKeyMap() KeyMap

type Model

type Model struct {

	// TODO(manuel, 2023-08-09) We can actually use the help widget from the list
	// by passing our own keys using AdditionalShortHelpKeys and such
	// however, not sure if this allows us to override the whole filtering stuff
	SearchInput textinput.Model

	KeyMap

	ShowSearch bool
	// contains filtered or unexported fields
}

func NewModel

func NewModel(client *bandcamp.Client, results []*bandcamp.Result) Model

func (Model) GetResults

func (m Model) GetResults() []*bandcamp.Result

func (Model) GetSearchTerm

func (m Model) GetSearchTerm() string

func (Model) GetSelectedResult

func (m Model) GetSelectedResult() *bandcamp.Result

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) SearchBandcamp

func (m Model) SearchBandcamp(searchTerm string) tea.Msg

func (*Model) SetShowSearch

func (m *Model) SetShowSearch(v bool)

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

type Result

type Result bandcamp.Result

func (*Result) Description

func (s *Result) Description() string

func (*Result) FilterValue

func (s *Result) FilterValue() string

func (*Result) Title

func (s *Result) Title() string

type SelectEntryMsg

type SelectEntryMsg struct {
	Result *bandcamp.Result
}

Jump to

Keyboard shortcuts

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