components

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: Apache-2.0 Imports: 23 Imported by: 1

Documentation

Index

Constants

View Source
const ErrorViewType = "error"
View Source
const FrameViewType = "frame"
View Source
const LoadingViewType = "loading"

Variables

This section is empty.

Functions

func RunMarkdownView added in v0.0.4

func RunMarkdownView(theme styles.Theme, appName, ctxKey, ctxValue, content string) error

Types

type CollectionView

type CollectionView struct {
	// contains filtered or unexported fields
}

func (*CollectionView) HelpMsg

func (v *CollectionView) HelpMsg() string

func (*CollectionView) Init

func (v *CollectionView) Init() tea.Cmd

func (*CollectionView) Interactive

func (v *CollectionView) Interactive() bool

func (*CollectionView) Items

func (v *CollectionView) Items() []list.Item

func (*CollectionView) Type

func (v *CollectionView) Type() string

func (*CollectionView) Update

func (v *CollectionView) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*CollectionView) UpdateItemsFromCollections

func (v *CollectionView) UpdateItemsFromCollections()

func (*CollectionView) View

func (v *CollectionView) View() string

type ContainerView

type ContainerView struct {
	// contains filtered or unexported fields
}

func InitalizeContainer

func InitalizeContainer(
	ctx context.Context,
	cancel context.CancelFunc,
	appName, headerCtxKey, headerCtxVal string,
	styles styles.Theme,
) *ContainerView

func (*ContainerView) FullHeight added in v0.0.14

func (a *ContainerView) FullHeight() int

FullHeight returns the full height of the terminal window including the header and footer

func (*ContainerView) HandleError

func (a *ContainerView) HandleError(err error)

func (*ContainerView) Height

func (a *ContainerView) Height() int

func (*ContainerView) Init

func (a *ContainerView) Init() tea.Cmd

func (*ContainerView) Ready

func (a *ContainerView) Ready() bool

func (*ContainerView) SetContext

func (a *ContainerView) SetContext(ctx string)

func (*ContainerView) SetNotice

func (a *ContainerView) SetNotice(notice string, lvl styles.NoticeLevel)

func (*ContainerView) SetView

func (a *ContainerView) SetView(model TeaModel)

func (*ContainerView) Shutdown added in v0.0.13

func (a *ContainerView) Shutdown()

func (*ContainerView) Update

func (a *ContainerView) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*ContainerView) View

func (a *ContainerView) View() string

func (*ContainerView) Width

func (a *ContainerView) Width() int

type EntityView

type EntityView struct {
	// contains filtered or unexported fields
}

func (*EntityView) HelpMsg

func (v *EntityView) HelpMsg() string

func (*EntityView) Init

func (v *EntityView) Init() tea.Cmd

func (*EntityView) Interactive

func (v *EntityView) Interactive() bool

func (*EntityView) Type

func (v *EntityView) Type() string

func (*EntityView) Update

func (v *EntityView) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*EntityView) View

func (v *EntityView) View() string

type ErrorView

type ErrorView struct {
	// contains filtered or unexported fields
}

func (*ErrorView) HelpMsg

func (v *ErrorView) HelpMsg() string

func (*ErrorView) Init

func (v *ErrorView) Init() tea.Cmd

func (*ErrorView) Interactive

func (v *ErrorView) Interactive() bool

func (*ErrorView) Type

func (v *ErrorView) Type() string

func (*ErrorView) Update

func (v *ErrorView) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*ErrorView) View

func (v *ErrorView) View() string

type Format

type Format string
const (
	FormatDocument Format = "doc"
	FormatList     Format = "list"
	FormatJSON     Format = "json"
	FormatYAML     Format = "yaml"
)

type FrameView added in v0.0.13

type FrameView struct {
	// contains filtered or unexported fields
}

func (*FrameView) HelpMsg added in v0.0.13

func (v *FrameView) HelpMsg() string

func (*FrameView) Init added in v0.0.13

func (v *FrameView) Init() tea.Cmd

func (*FrameView) Interactive added in v0.0.13

func (v *FrameView) Interactive() bool

func (*FrameView) Type added in v0.0.13

func (v *FrameView) Type() string

func (*FrameView) Update added in v0.0.13

func (v *FrameView) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*FrameView) View added in v0.0.13

func (v *FrameView) View() string

type KeyCallback

type KeyCallback struct {
	Key      string
	Label    string
	Callback func() error
}

type LoadingView

type LoadingView struct {
	// contains filtered or unexported fields
}

func (*LoadingView) HelpMsg

func (v *LoadingView) HelpMsg() string

func (*LoadingView) Init

func (v *LoadingView) Init() tea.Cmd

func (*LoadingView) Interactive

func (v *LoadingView) Interactive() bool

func (*LoadingView) Type

func (v *LoadingView) Type() string

func (*LoadingView) Update

func (v *LoadingView) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*LoadingView) View

func (v *LoadingView) View() string

type LogArchiveView added in v0.0.4

type LogArchiveView struct {
	// contains filtered or unexported fields
}

func (*LogArchiveView) HelpMsg added in v0.0.4

func (v *LogArchiveView) HelpMsg() string

func (*LogArchiveView) Init added in v0.0.4

func (v *LogArchiveView) Init() tea.Cmd

func (*LogArchiveView) Interactive added in v0.0.4

func (v *LogArchiveView) Interactive() bool

func (*LogArchiveView) Type added in v0.0.4

func (v *LogArchiveView) Type() string

func (*LogArchiveView) Update added in v0.0.4

func (v *LogArchiveView) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*LogArchiveView) View added in v0.0.4

func (v *LogArchiveView) View() string

type MarkdownView

type MarkdownView struct {
	// contains filtered or unexported fields
}

func (*MarkdownView) HelpMsg

func (v *MarkdownView) HelpMsg() string

func (*MarkdownView) Init

func (v *MarkdownView) Init() tea.Cmd

func (*MarkdownView) Interactive

func (v *MarkdownView) Interactive() bool

func (*MarkdownView) RunProgram added in v0.0.4

func (v *MarkdownView) RunProgram() error

func (*MarkdownView) Type

func (v *MarkdownView) Type() string

func (*MarkdownView) Update

func (v *MarkdownView) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*MarkdownView) View

func (v *MarkdownView) View() string

type NoticeLevel

type NoticeLevel string

type TeaModel

type TeaModel interface {
	tea.Model

	Interactive() bool
	HelpMsg() string
	Type() string
}

func NewCollectionView

func NewCollectionView(
	state *TerminalState,
	collection types.Collection,
	format Format,
	selectedFunc func(header string) error,
	keys ...KeyCallback,
) TeaModel

func NewEntityView

func NewEntityView(
	state *TerminalState,
	entity types.Entity,
	format Format,
	keys ...KeyCallback,
) TeaModel

func NewErrorView

func NewErrorView(err error, styles styles.Theme) TeaModel

func NewFrameView added in v0.0.13

func NewFrameView(model tea.Model) TeaModel

func NewLoadingView

func NewLoadingView(msg string, styles styles.Theme) TeaModel

func NewLogArchiveView added in v0.0.4

func NewLogArchiveView(state *TerminalState, archiveDir string, lastEntry bool) TeaModel

type TerminalState

type TerminalState struct {
	Width  int
	Height int
	Theme  styles.Theme
}

type TextInput

type TextInput struct {
	Key         string
	Prompt      string
	Placeholder string
	Hidden      bool
	// contains filtered or unexported fields
}

func (*TextInput) HelpMsg

func (t *TextInput) HelpMsg() string

func (*TextInput) Init

func (t *TextInput) Init() tea.Cmd

func (*TextInput) Interactive

func (t *TextInput) Interactive() bool

func (*TextInput) RunProgram

func (t *TextInput) RunProgram(styles styles.Theme) (string, error)

func (*TextInput) Type

func (t *TextInput) Type() string

func (*TextInput) Update

func (t *TextInput) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*TextInput) Value

func (t *TextInput) Value() string

func (*TextInput) View

func (t *TextInput) View() string

type TextInputList

type TextInputList []*TextInput

func ProcessInputs

func ProcessInputs(styles styles.Theme, inputs ...*TextInput) (TextInputList, error)

func (TextInputList) FindByKey

func (t TextInputList) FindByKey(key string) *TextInput

func (TextInputList) ValueMap

func (t TextInputList) ValueMap() map[string]string

type TickMsg

type TickMsg time.Time

Jump to

Keyboard shortcuts

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