Documentation ¶
Index ¶
- Variables
- func Draw(page Page, options SunbeamOptions) error
- func RenderAction(action types.Action, old, new string) types.Action
- func RenderCommand(command *types.Command, old, new string) *types.Command
- func RenderExpression(expression *types.Expression, old, new string) *types.Expression
- func RenderRequest(request *types.Request, old, new string) *types.Request
- func RenderTextProvider(pageProvider *types.TextProvider, old, new string) *types.TextProvider
- type ActionList
- func (al *ActionList) Blur()
- func (al *ActionList) Clear()
- func (al *ActionList) Focus() tea.Cmd
- func (al ActionList) Focused() bool
- func (al *ActionList) SetActions(actions ...types.Action)
- func (al *ActionList) SetSize(w, h int)
- func (al *ActionList) SetTitle(title string)
- func (al ActionList) Update(msg tea.Msg) (ActionList, tea.Cmd)
- func (al ActionList) View() string
- type Checkbox
- type CommandRunner
- func (c *CommandRunner) Focus() tea.Cmd
- func (c *CommandRunner) Init() tea.Cmd
- func (runner CommandRunner) IsLoading() bool
- func (runner *CommandRunner) Refresh() tea.Msg
- func (c *CommandRunner) SetIsloading(isLoading bool) tea.Cmd
- func (c *CommandRunner) SetSize(width, height int)
- func (runner *CommandRunner) Update(msg tea.Msg) (Page, tea.Cmd)
- func (c *CommandRunner) View() string
- type ContentMsg
- type Detail
- type DetailMsg
- type DropDown
- func (d *DropDown) Blur()
- func (d *DropDown) Focus() tea.Cmd
- func (dd DropDown) HasMatch() bool
- func (dd *DropDown) Height() int
- func (dd *DropDown) SetWidth(width int)
- func (d DropDown) Title() string
- func (d *DropDown) Update(msg tea.Msg) (FormInput, tea.Cmd)
- func (d DropDown) Value() string
- func (dd DropDown) View() string
- type DropDownItem
- type ExitMsg
- type Filter
- func (m *Filter) CursorDown()
- func (m *Filter) CursorUp()
- func (f *Filter) FilterItems(query string)
- func (m Filter) Init() tea.Cmd
- func (f *Filter) Select(id string)
- func (f Filter) Selection() FilterItem
- func (f *Filter) SetItems(items []FilterItem)
- func (f *Filter) SetSize(width, height int)
- func (f Filter) Update(msg tea.Msg) (Filter, tea.Cmd)
- func (m Filter) View() string
- type FilterItem
- type Footer
- type Form
- func (c *Form) CurrentItem() FormInput
- func (c Form) Focus() tea.Cmd
- func (c Form) Init() tea.Cmd
- func (c *Form) ScrollViewport()
- func (c *Form) SetIsLoading(isLoading bool) tea.Cmd
- func (c *Form) SetSize(width, height int)
- func (c Form) Update(msg tea.Msg) (Page, tea.Cmd)
- func (c *Form) View() string
- type FormInput
- type FormItem
- type Header
- type IsLoadingMsg
- type List
- func (c *List) Focus() tea.Cmd
- func (c *List) Init() tea.Cmd
- func (c List) Query() string
- func (c *List) RefreshDetail()
- func (c List) Selection() *ListItem
- func (c *List) SetIsLoading(isLoading bool) tea.Cmd
- func (c *List) SetItems(items []ListItem, selectedId string) tea.Cmd
- func (c *List) SetQuery(query string)
- func (c *List) SetSize(width, height int)
- func (c *List) Update(msg tea.Msg) (Page, tea.Cmd)
- func (c List) View() string
- type ListItem
- type Match
- type Page
- type PageGenerator
- func GeneratorFromAction(action types.Action) (PageGenerator, error)
- func NewCommandGenerator(command *types.Command) PageGenerator
- func NewFileGenerator(name string) PageGenerator
- func NewPageProviderGenerator(pageProvider *types.TextProvider) PageGenerator
- func NewRequestGenerator(request *types.Request) PageGenerator
- func NewStaticGenerator(reader io.Reader) PageGenerator
- type Paginator
- func (m *Paginator) Init() tea.Cmd
- func (m Paginator) MarginHorizontal(width int) int
- func (m Paginator) MarginVertical(height int) int
- func (m *Paginator) Pop() tea.Cmd
- func (m *Paginator) Push(page Page) tea.Cmd
- func (m *Paginator) SetSize(width, height int)
- func (m *Paginator) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m *Paginator) View() string
- type PopPageMsg
- type PushPageMsg
- type QueryChangeMsg
- type SelectionChangeMsg
- type SubmitFormMsg
- type SunbeamOptions
- type TextArea
- type TextInput
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInterrupted = errors.New("interrupted")
Functions ¶
func Draw ¶ added in v0.9.25
func Draw(page Page, options SunbeamOptions) error
func RenderCommand ¶ added in v0.9.18
func RenderExpression ¶
func RenderExpression(expression *types.Expression, old, new string) *types.Expression
func RenderTextProvider ¶
func RenderTextProvider(pageProvider *types.TextProvider, old, new string) *types.TextProvider
Types ¶
type ActionList ¶
type ActionList struct {
// contains filtered or unexported fields
}
func NewActionList ¶
func NewActionList() ActionList
func (*ActionList) Blur ¶
func (al *ActionList) Blur()
func (*ActionList) Clear ¶
func (al *ActionList) Clear()
func (*ActionList) Focus ¶
func (al *ActionList) Focus() tea.Cmd
func (ActionList) Focused ¶
func (al ActionList) Focused() bool
func (*ActionList) SetActions ¶
func (al *ActionList) SetActions(actions ...types.Action)
func (*ActionList) SetSize ¶
func (al *ActionList) SetSize(w, h int)
func (*ActionList) SetTitle ¶
func (al *ActionList) SetTitle(title string)
func (ActionList) Update ¶
func (al ActionList) Update(msg tea.Msg) (ActionList, tea.Cmd)
func (ActionList) View ¶
func (al ActionList) View() string
type Checkbox ¶
type Checkbox struct {
// contains filtered or unexported fields
}
func NewCheckbox ¶
type CommandRunner ¶
type CommandRunner struct { Generator PageGenerator // contains filtered or unexported fields }
func NewRunner ¶
func NewRunner(generator PageGenerator) *CommandRunner
func (*CommandRunner) Focus ¶ added in v0.9.25
func (c *CommandRunner) Focus() tea.Cmd
func (*CommandRunner) Init ¶
func (c *CommandRunner) Init() tea.Cmd
func (CommandRunner) IsLoading ¶
func (runner CommandRunner) IsLoading() bool
func (*CommandRunner) Refresh ¶
func (runner *CommandRunner) Refresh() tea.Msg
func (*CommandRunner) SetIsloading ¶
func (c *CommandRunner) SetIsloading(isLoading bool) tea.Cmd
func (*CommandRunner) SetSize ¶
func (c *CommandRunner) SetSize(width, height int)
func (*CommandRunner) View ¶
func (c *CommandRunner) View() string
type ContentMsg ¶
type ContentMsg string
type Detail ¶
type Detail struct { Style lipgloss.Style ContentCmd func() string // contains filtered or unexported fields }
func (*Detail) RefreshContent ¶
func (c *Detail) RefreshContent()
type DropDown ¶
type DropDown struct {
// contains filtered or unexported fields
}
func NewDropDown ¶
type DropDownItem ¶
type DropDownItem struct {
// contains filtered or unexported fields
}
func (DropDownItem) FilterValue ¶
func (d DropDownItem) FilterValue() string
func (DropDownItem) ID ¶
func (d DropDownItem) ID() string
type Filter ¶
type Filter struct {
Width, Height int
Query string
Less func(i, j FilterItem) bool
EmptyText string
DrawLines bool
// contains filtered or unexported fields
}
func (*Filter) CursorDown ¶
func (m *Filter) CursorDown()
func (*Filter) FilterItems ¶
func (Filter) Selection ¶
func (f Filter) Selection() FilterItem
func (*Filter) SetItems ¶
func (f *Filter) SetItems(items []FilterItem)
type FilterItem ¶
type Footer ¶
type Footer struct { // contains filtered or unexported fields }
func (*Footer) SetBindings ¶
type Form ¶
type Form struct {
// contains filtered or unexported fields
}
func (*Form) CurrentItem ¶
func (*Form) ScrollViewport ¶
func (c *Form) ScrollViewport()
type IsLoadingMsg ¶
type IsLoadingMsg struct{}
type List ¶
type List struct { DetailFunc func(types.ListItem) string ReloadOnQueryChange bool ShowDetail bool // contains filtered or unexported fields }
func (*List) RefreshDetail ¶
func (c *List) RefreshDetail()
type ListItem ¶
Probably not necessary, need to be refactored
func ParseScriptItem ¶
func (ListItem) FilterValue ¶
type PageGenerator ¶
func GeneratorFromAction ¶
func GeneratorFromAction(action types.Action) (PageGenerator, error)
func NewCommandGenerator ¶
func NewCommandGenerator(command *types.Command) PageGenerator
func NewFileGenerator ¶
func NewFileGenerator(name string) PageGenerator
func NewPageProviderGenerator ¶
func NewPageProviderGenerator(pageProvider *types.TextProvider) PageGenerator
func NewRequestGenerator ¶
func NewRequestGenerator(request *types.Request) PageGenerator
func NewStaticGenerator ¶ added in v0.9.2
func NewStaticGenerator(reader io.Reader) PageGenerator
type Paginator ¶
type Paginator struct { OutputCmd *exec.Cmd OutputMsg string Cancelled bool // contains filtered or unexported fields }
func NewPaginator ¶
func NewPaginator(root Page, options SunbeamOptions) *Paginator
func (Paginator) MarginHorizontal ¶
func (Paginator) MarginVertical ¶
type PopPageMsg ¶
type PopPageMsg struct{}
type PushPageMsg ¶
type PushPageMsg struct {
Page Page
}
type QueryChangeMsg ¶ added in v0.9.18
type QueryChangeMsg struct {
Query string
}
type SelectionChangeMsg ¶
type SelectionChangeMsg struct {
SelectionId string
}
type SubmitFormMsg ¶
type SunbeamOptions ¶
type TextArea ¶
func NewTextArea ¶
type TextInput ¶
func NewTextInput ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.