Documentation ¶
Index ¶
- Variables
- func ChangeSetEntry(m *ssa.ResourceManager, o *unstructured.Unstructured, action ssa.Action) *ssa.ChangeSetEntry
- func ChangeSetEntryToObjMetadataSet(entry ssa.ChangeSetEntry) object.ObjMetadataSet
- func EntriesReady(changeSet *ssa.ChangeSet) int
- func InstallCmd[T any](i *Installer[T]) tea.Cmd
- func RemoveChangeSetEntry(entry ssa.ChangeSetEntry, changeSet *ssa.ChangeSet) *ssa.ChangeSet
- func SetChangeSetEntry(entry ssa.ChangeSetEntry, changeSet *ssa.ChangeSet)
- func ToUnstructured(obj runtime.Object) (*unstructured.Unstructured, error)
- func WaitCmd[T any](i *Installer[T], changeSetEntry ssa.ChangeSetEntry) tea.Cmd
- type BasicItem
- type BasicItemList
- type ChoiceQuestion
- func (i ChoiceQuestion[T]) ID() string
- func (i ChoiceQuestion[T]) Init() tea.Cmd
- func (i ChoiceQuestion[T]) Next(model T) string
- func (i ChoiceQuestion[T]) Render(model T) string
- func (i ChoiceQuestion[T]) Result(model T) (string, error)
- func (i ChoiceQuestion[T]) UpdateResult(model T, value interface{}) error
- func (i ChoiceQuestion[T]) UpdateTea(model T, msg tea.Msg) (Task[T], tea.Cmd)
- type ChoiceQuestionOpts
- type CreatedEntry
- type Foo
- type InputQuestionOpts
- type Installer
- func (i Installer[T]) ID() string
- func (i Installer[T]) Init() tea.Cmd
- func (i Installer[T]) Initialized() bool
- func (i Installer[T]) Next(model T) string
- func (i Installer[T]) Render(model T) string
- func (i Installer[T]) Result(model T) (string, error)
- func (i Installer[T]) UpdateResult(model T, value interface{}) error
- func (i *Installer[T]) UpdateTea(model T, msg tea.Msg) (Task[T], tea.Cmd)
- type InstallerOpts
- type InstructionOpts
- type ItemGetter
- type ItemList
- type Program
- type ReadyEntry
- type SelectItem
- type SelectItemGetter
- type SelectQuestion
- func (i SelectQuestion[T]) ID() string
- func (i SelectQuestion[T]) Init() tea.Cmd
- func (i SelectQuestion[T]) Next(model T) string
- func (i SelectQuestion[T]) Render(model T) string
- func (i SelectQuestion[T]) Result(model T) (string, error)
- func (i SelectQuestion[T]) UpdateResult(model T, value interface{}) error
- func (i SelectQuestion[T]) UpdateTea(model T, msg tea.Msg) (Task[T], tea.Cmd)
- type SelectQuestionOpts
- type Stage
- type StageOpts
- type Task
- func NewChoiceQuestion[T any](id string, opts ChoiceQuestionOpts[T]) Task[T]
- func NewInputQuestion[T any](id string, opts InputQuestionOpts[T]) Task[T]
- func NewInstaller[T any](id string, opts InstallerOpts[T]) Task[T]
- func NewInstruction[T any](id string, opts InstructionOpts[T]) Task[T]
- func NewSelectQuestion[T any](id string, opts SelectQuestionOpts[T]) Task[T]
- func NewTask[T any](id string, opts TaskOpts[T], render func(T) string) Task[T]
- func NewTextAreaQuestion[T any](id string, opts TextAreaQuestionOpts[T]) Task[T]
- type TaskOpts
- type TextAreaQuestionOpts
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Feint = lipgloss.AdaptiveColor{Light: "#333333", Dark: "#888888"} Color = lipgloss.AdaptiveColor{Light: "#111222", Dark: "#FAFAFA"} TextStyle = lipgloss.NewStyle().Foreground(Color) FeintStyle = TextStyle.Copy().Foreground(Feint) BoldStyle = TextStyle.Copy().Bold(true) )
View Source
var (
ErrNotCompleted = fmt.Errorf("this tasks is not completed")
)
Functions ¶
func ChangeSetEntry ¶
func ChangeSetEntry(m *ssa.ResourceManager, o *unstructured.Unstructured, action ssa.Action) *ssa.ChangeSetEntry
func ChangeSetEntryToObjMetadataSet ¶
func ChangeSetEntryToObjMetadataSet(entry ssa.ChangeSetEntry) object.ObjMetadataSet
func EntriesReady ¶
func RemoveChangeSetEntry ¶
func SetChangeSetEntry ¶
func SetChangeSetEntry(entry ssa.ChangeSetEntry, changeSet *ssa.ChangeSet)
func ToUnstructured ¶
func ToUnstructured(obj runtime.Object) (*unstructured.Unstructured, error)
Types ¶
type BasicItemList ¶
type BasicItemList struct {
List []BasicItem
}
func (BasicItemList) Items ¶
func (i BasicItemList) Items() []list.Item
type ChoiceQuestion ¶
type ChoiceQuestion[T any] struct { // contains filtered or unexported fields }
func (ChoiceQuestion[T]) ID ¶
func (i ChoiceQuestion[T]) ID() string
func (ChoiceQuestion[T]) Init ¶
func (i ChoiceQuestion[T]) Init() tea.Cmd
Next returns the next question in the chain
func (ChoiceQuestion[T]) Next ¶
func (i ChoiceQuestion[T]) Next(model T) string
Next returns the next question in the chain
func (ChoiceQuestion[T]) Render ¶
func (i ChoiceQuestion[T]) Render(model T) string
Render renders the question.
func (ChoiceQuestion[T]) Result ¶
func (i ChoiceQuestion[T]) Result(model T) (string, error)
func (ChoiceQuestion[T]) UpdateResult ¶
func (i ChoiceQuestion[T]) UpdateResult(model T, value interface{}) error
type ChoiceQuestionOpts ¶
type ChoiceQuestionOpts[T any] struct { TaskOpts[T] Prompt string // OffsetY represents the list offset from the Y position. PaddingY int // ItemGetter returns all available items to the list // items on each render of the list. // // This is required. ItemGetter ItemGetter // Items []list.Item // TeaState allows overriding the list.Model used to render the list, if desired. // // This is an optional field. It is a pointer, and can be mutated outside // of the Tea framework. TeaState *list.Model // Render optionally handles rendering the text list manually. Render func(model T, textinput list.Model) string }
type CreatedEntry ¶
type CreatedEntry struct {
Entry *ssa.ChangeSetEntry
}
type InputQuestionOpts ¶
type InputQuestionOpts[T any] struct { TaskOpts[T] Prompt string Placeholder string // Render optionally handles rendering the text input manually. Render func(model T, textinput textinput.Model) string // TeaState allows overriding the textinput.Model used to render the // text input. // // This is an optional field. TeaState *textinput.Model }
type Installer ¶
type Installer[T any] struct { // contains filtered or unexported fields }
func (Installer[T]) Initialized ¶
func (Installer[T]) UpdateResult ¶
type InstallerOpts ¶
type InstructionOpts ¶
type ItemGetter ¶
type ItemList ¶
type ItemList struct {
List []SelectItem
}
func (ItemList) Items ¶
func (i ItemList) Items() []SelectItem
type ReadyEntry ¶
type ReadyEntry struct {
Entry *ssa.ChangeSetEntry
}
type SelectItem ¶
func (SelectItem) Description ¶
func (i SelectItem) Description() string
func (SelectItem) FilterValue ¶
func (i SelectItem) FilterValue() string
func (SelectItem) Title ¶
func (i SelectItem) Title() string
type SelectItemGetter ¶
type SelectItemGetter interface {
Items() []SelectItem
}
type SelectQuestion ¶
type SelectQuestion[T any] struct { // contains filtered or unexported fields }
func (SelectQuestion[T]) ID ¶
func (i SelectQuestion[T]) ID() string
func (SelectQuestion[T]) Init ¶
func (i SelectQuestion[T]) Init() tea.Cmd
Next returns the next question in the chain
func (SelectQuestion[T]) Next ¶
func (i SelectQuestion[T]) Next(model T) string
Next returns the next question in the chain
func (SelectQuestion[T]) Render ¶
func (i SelectQuestion[T]) Render(model T) string
Render renders the question.
func (SelectQuestion[T]) Result ¶
func (i SelectQuestion[T]) Result(model T) (string, error)
func (SelectQuestion[T]) UpdateResult ¶
func (i SelectQuestion[T]) UpdateResult(model T, value interface{}) error
type SelectQuestionOpts ¶
type SelectQuestionOpts[T any] struct { TaskOpts[T] Cursor int Prompt string MultiSelect bool // OffsetY represents the list offset from the Y position. PaddingY int // ItemGetter returns all available items to the list // items on each render of the list. // // This is required. ItemGetter SelectItemGetter // TeaState allows overriding the list.Model used to render the list, if desired. // // This is an optional field. It is a pointer, and can be mutated outside // of the Tea framework. TeaState *list.Model // Render optionally handles rendering the text list manually. Render func(model T, textinput list.Model) string }
type Stage ¶
type Task ¶
type Task[T any] interface { // ID allows us to reference tasks, eg. for setting the root ID() string // Result returns the result as a string. If the tasks is // not completed, this must return the error ErrNotCompleted. Result(T) (string, error) // Render renders the tasks. Render(T) string // UpdateTea updates the model T via Bubbletea UI, returning any // commands necessary to re-render the state. UpdateTea(model T, msg tea.Msg) (Task[T], tea.Cmd) // UpdateResult is called when the qestion is completed. UpdateResult(model T, answer interface{}) error // Next returns the next tasks in the chain Next(T) string Init() tea.Cmd }
func NewChoiceQuestion ¶
func NewChoiceQuestion[T any](id string, opts ChoiceQuestionOpts[T]) Task[T]
func NewInputQuestion ¶
func NewInputQuestion[T any](id string, opts InputQuestionOpts[T]) Task[T]
func NewInstaller ¶
func NewInstaller[T any](id string, opts InstallerOpts[T]) Task[T]
func NewInstruction ¶
func NewInstruction[T any](id string, opts InstructionOpts[T]) Task[T]
func NewSelectQuestion ¶
func NewSelectQuestion[T any](id string, opts SelectQuestionOpts[T]) Task[T]
func NewTextAreaQuestion ¶
func NewTextAreaQuestion[T any](id string, opts TextAreaQuestionOpts[T]) Task[T]
type TaskOpts ¶
type TaskOpts[T any] struct { // Result returns the current result as a string for display, or // ErrNotCompleted if this tasks has no result. Result func(T) (string, error) // UpdateResult is called with the answer from the tasks to // update the model. // // This must return a custom error if the result is invalid, // or ErrNotCompleted if there's no result. UpdateResult func(T, interface{}) error // Next returns the ID of the next tasks in the chain, if applicable. Next func(T) string // UpdateTea is called when receing a tea.Msg to update any internal // tea models. UpdateTea func(model T, msg tea.Msg) (Task[T], tea.Cmd) }
type TextAreaQuestionOpts ¶
type TextAreaQuestionOpts[T any] struct { TaskOpts[T] Prompt string Placeholder string // Render optionally handles rendering the text textArea manually. Render func(model T, textArea textarea.Model) string // TeaState allows overriding the textArea.Model used to render the // text input. // // This is an optional field. TeaState *textarea.Model }
Click to show internal directories.
Click to hide internal directories.