Documentation
¶
Index ¶
- func SetStackInContext(ctx context.Context, stack *StackModel) context.Context
- type BackMsg
- type CTXKey
- type CTXValue
- type ClearScreenMsg
- type ConfigWrapper
- type ConfirmModel
- type CustomOption
- type DimensionModel
- type DoneLoadingDataMsg
- type DoneMsg
- type ErrorModel
- type ErrorMsg
- type ExecDone
- type ExecModel
- type Form
- type FormAction
- type FormWithAction
- type List
- type ListItem
- type ListOption
- type LoadDataMsg
- type LoadFunc
- type LoadingDataMsg
- type LogModel
- type LogResult
- type ModelWithCmd
- type ModelWithConfirm
- type ScrollBarModel
- type ShowConfirmMsg
- type SimpleLoadedMsg
- type SimpleModel
- type StackModel
- func (m *StackModel) Init() tea.Cmd
- func (m *StackModel) Pop() *ModelWithCmd
- func (m *StackModel) Push(model ModelWithCmd) tea.Cmd
- func (m *StackModel) PushError(err error) tea.Cmd
- func (m *StackModel) StackSizeMsg() StackSizeMsg
- func (m *StackModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m *StackModel) View() string
- func (m *StackModel) WithDone(f func(tea.Msg) (tea.Model, tea.Cmd))
- type StackSizeMsg
- type Tab
- type TabModel
- func (m *TabModel) CurrentTab() *Tab
- func (m *TabModel) Header() string
- func (m *TabModel) Init() tea.Cmd
- func (m *TabModel) KeyBinds() []key.Binding
- func (m *TabModel) SetHeight(height int)
- func (m *TabModel) SetWidth(width int)
- func (m *TabModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m *TabModel) View() string
- type Table
- type TableOption
- type TypedCmd
- type UserFacingError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetStackInContext ¶
func SetStackInContext(ctx context.Context, stack *StackModel) context.Context
Types ¶
type CTXValue ¶
type CTXValue struct {
Stack *StackModel
}
type ClearScreenMsg ¶
ClearScreenMsg is a message that clears the screen before rendering the next message
type ConfigWrapper ¶
type ConfigWrapper struct {
// contains filtered or unexported fields
}
func NewConfigWrapper ¶
func (*ConfigWrapper) Init ¶
func (c *ConfigWrapper) Init() tea.Cmd
func (*ConfigWrapper) View ¶
func (c *ConfigWrapper) View() string
type ConfirmModel ¶
type ConfirmModel struct {
// contains filtered or unexported fields
}
func NewConfirmModel ¶
func (*ConfirmModel) Init ¶
func (m *ConfirmModel) Init() tea.Cmd
func (*ConfirmModel) Update ¶
func (m *ConfirmModel) Update(msg tea.Msg) (*ConfirmModel, tea.Cmd)
func (*ConfirmModel) View ¶
func (m *ConfirmModel) View() string
type CustomOption ¶
func (CustomOption) String ¶
func (o CustomOption) String() string
type DimensionModel ¶
DimensionModel is an extension of tea.Model that implements a SetWidth and SetHeight method. This allows for models to handle their own sizing. For models that contain child models, their implementation to SetWidth and SetHeight should also call SetWidth and SetHeight on the child models and subtract out any padding or margins that the parent model may have.
This allows for a more flexible and composable layout system, where each model is in charge of its own size and layout.
type DoneLoadingDataMsg ¶
type DoneLoadingDataMsg struct{}
type DoneMsg ¶
type DoneMsg struct {
Message string
}
DoneMsg quits the program after displaying a message
type ErrorModel ¶
type ErrorModel struct { Err error // contains filtered or unexported fields }
func NewErrorModel ¶
func NewErrorModel( err error, ) *ErrorModel
func (*ErrorModel) Init ¶
func (m *ErrorModel) Init() tea.Cmd
func (*ErrorModel) View ¶
func (m *ErrorModel) View() string
type ErrorMsg ¶
type ErrorMsg struct {
Err error
}
ErrorMsg quits the program after displaying an error message
type FormAction ¶
type FormAction[T any] struct { // contains filtered or unexported fields }
func NewFormAction ¶
func NewFormAction[T any]( action func(T) tea.Cmd, onSubmit TypedCmd[T], ) FormAction[T]
func (*FormAction[T]) Init ¶
func (fa *FormAction[T]) Init() tea.Cmd
func (*FormAction[T]) View ¶
func (fa *FormAction[T]) View() string
type FormWithAction ¶
type FormWithAction[T any] struct { // contains filtered or unexported fields }
func NewFormWithAction ¶
func NewFormWithAction[T any](action FormAction[T], form tea.Model) *FormWithAction[T]
func (*FormWithAction[T]) Init ¶
func (df *FormWithAction[T]) Init() tea.Cmd
func (*FormWithAction[T]) View ¶
func (df *FormWithAction[T]) View() string
type ListOption ¶
func WithOnSelect ¶
func WithOnSelect[T any](onSelect func(ListItem) tea.Cmd) ListOption[T]
type LoadDataMsg ¶
type LoadingDataMsg ¶
type LogModel ¶
type LogModel struct {
// contains filtered or unexported fields
}
func NewLogModel ¶
type LogResult ¶
type LogResult struct { Logs *client.Logs200Response LogChannel <-chan *lclient.Log }
type ModelWithConfirm ¶
type ModelWithConfirm struct {
// contains filtered or unexported fields
}
func NewModelWithConfirm ¶
func NewModelWithConfirm(model tea.Model) *ModelWithConfirm
func (*ModelWithConfirm) Init ¶
func (m *ModelWithConfirm) Init() tea.Cmd
func (*ModelWithConfirm) View ¶
func (m *ModelWithConfirm) View() string
type ScrollBarModel ¶
type ScrollBarModel struct {
// contains filtered or unexported fields
}
func NewScrollBarModel ¶
func NewScrollBarModel( height int, percent float64, ) *ScrollBarModel
func (*ScrollBarModel) Init ¶
func (m *ScrollBarModel) Init() tea.Cmd
func (*ScrollBarModel) ScrollPercent ¶
func (m *ScrollBarModel) ScrollPercent(percent float64)
func (*ScrollBarModel) SetHeight ¶
func (m *ScrollBarModel) SetHeight(height int)
func (*ScrollBarModel) Update ¶
func (m *ScrollBarModel) Update(_ tea.Msg) (*ScrollBarModel, tea.Cmd)
func (*ScrollBarModel) View ¶
func (m *ScrollBarModel) View() string
type ShowConfirmMsg ¶
type SimpleLoadedMsg ¶
type SimpleLoadedMsg string
type SimpleModel ¶
type SimpleModel struct {
// contains filtered or unexported fields
}
func NewSimpleModel ¶
func NewSimpleModel(loadFunc TypedCmd[string]) *SimpleModel
func (*SimpleModel) Init ¶
func (m *SimpleModel) Init() tea.Cmd
func (*SimpleModel) View ¶
func (m *SimpleModel) View() string
type StackModel ¶
type StackModel struct {
// contains filtered or unexported fields
}
func GetStackFromContext ¶
func GetStackFromContext(ctx context.Context) *StackModel
func NewStack ¶
func NewStack() *StackModel
func (*StackModel) Init ¶
func (m *StackModel) Init() tea.Cmd
func (*StackModel) Pop ¶
func (m *StackModel) Pop() *ModelWithCmd
func (*StackModel) Push ¶
func (m *StackModel) Push(model ModelWithCmd) tea.Cmd
func (*StackModel) StackSizeMsg ¶
func (m *StackModel) StackSizeMsg() StackSizeMsg
func (*StackModel) View ¶
func (m *StackModel) View() string
type StackSizeMsg ¶
type Tab ¶
type Tab struct { Name string Content DimensionModel }
type TabModel ¶
type TabModel struct { Tabs []*Tab // contains filtered or unexported fields }
Adapted from the tabs bubbletea example: https://github.com/charmbracelet/bubbletea/tree/main/examples/tabs
func NewTabModel ¶
func (*TabModel) CurrentTab ¶
type TableOption ¶
func WithCustomOptions ¶
func WithCustomOptions[T any](options []CustomOption) TableOption[T]
func WithHeader ¶
func WithHeader[T any](message string) TableOption[T]
type TypedCmd ¶
TypedCmd is a wrapper around tea.Cmd that allows us to specify the type of data that the command will return. Since tea.Cmd is just a function that returns a message, it can be used to return any type of data. This wrapper allows us to have a more type-safe way of dealing with commands that return specific types of data.
Only the wrapper should be used to create a TypedCmd. And the function inside the type should never be executed directly. Instead, we should return the `tea.Cmd` from an Update or Init function on a `tea.Model`.
type UserFacingError ¶
func (UserFacingError) Error ¶
func (u UserFacingError) Error() string