fragments

package
v1.55.4 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CustomTag

func CustomTag(text string, foreground lipgloss.CompleteAdaptiveColor, background lipgloss.CompleteAdaptiveColor) string

CustomTag renders a tag with the given text, foreground, background and width e.g. CustomTag("hello", tui.Colors.White, tui.Colors.Purple, 8) Use Tag() for a standard tag.

func ErrorList

func ErrorList(errs []error, opts ...ErrorListOption) string

ErrorList renders a list of errors as a dot point list

func ErrorTag

func ErrorTag() string

func Hotkey added in v1.40.5

func Hotkey(key string, description string) string

Hotkey renders a hotkey fragment e.g. q: quit

func NitricTag

func NitricTag() string

NitricTag renders a standard tag with the title "nitric"

func Tag

func Tag(text string) string

Tag renders a standard tag with the given title

func TagWidth

func TagWidth() int

TagWidth returns the width of tags, which auto adjusts based on the longest tag rendered

Types

type ErrorListOption

type ErrorListOption = func(*ErrorListOptions) *ErrorListOptions

func WithCustomHeading

func WithCustomHeading(heading string) ErrorListOption

WithCustomHeading sets a custom heading for the error list

type ErrorListOptions

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

func WithoutHeading

func WithoutHeading(ol *ErrorListOptions) *ErrorListOptions

type StatusNode

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

StatusNode assists with rendering a tree of nodes, each with an optional status e.g. Api::main

├─aws:apigatewayv2/api:Api::main                               updated (3s)
├─aws:lambda/permission:Permission::maintwilight-sun_services- unchanged (0s)
│   hello
└─aws:apigatewayv2/stage:Stage::mainDefaultStage               unchanged (0s)

KeyValueStore::cache

└─aws:dynamodb/table:Table::cache                              unchanged (0s)

func NewStatusNode

func NewStatusNode(name string, status string) *StatusNode

func (*StatusNode) AddNode

func (s *StatusNode) AddNode(name string, status string) *StatusNode

func (StatusNode) Children

func (n StatusNode) Children() []*StatusNode

func (StatusNode) Name

func (n StatusNode) Name() string

func (StatusNode) Render

func (n StatusNode) Render(maxWidth int) string

Render this node as a tree maxNameWidth sets the maximum width of the names of nodes in the tree. the total width is maxNameWidth + 1 + maxStatusWidth

func (StatusNode) Status

func (n StatusNode) Status() string

Jump to

Keyboard shortcuts

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