Documentation ¶
Index ¶
- Variables
- func Factory[T any](x T) func() T
- func Indent(level uint) io.Writer
- func IndentString(level uint, str string) string
- func IndentWriter(w io.Writer, level uint) io.Writer
- func SnakeToTitle(s any) string
- type ColorScheme
- type Style
- func (s Style) Copy() Style
- func (s Style) Inherit(styles ...Style) Style
- func (s Style) InheritLipgloss(styles ...lipgloss.Style) Style
- func (s Style) Lipgloss() lipgloss.Style
- func (s Style) Print(str any) (int, error)
- func (s Style) Printf(format string, a ...any) (int, error)
- func (s Style) S(str any) string
- func (s Style) Sprint(str any) string
- func (s Style) Sprintf(format string, a ...any) string
- func (s Style) String() string
- func (s Style) WithOutput(output io.Writer) Style
- func (s Style) WithString(str string) Style
- func (s Style) Write(b []byte) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
var Colors = DefaultColorScheme()
Colors contains the default doctl color scheme.
var ( // ErrCanceled represents a user-initiated cancellation. ErrCanceled = fmt.Errorf("canceled") )
Functions ¶
func IndentString ¶
func SnakeToTitle ¶
Types ¶
type ColorScheme ¶
type ColorScheme struct { Success lipgloss.Color Warning lipgloss.Color Error lipgloss.Color Highlight lipgloss.Color Muted lipgloss.Color }
ColorScheme describes a color scheme.
func DefaultColorScheme ¶
func DefaultColorScheme() ColorScheme
DefaultColorScheme returns doctl's default color scheme.
type Style ¶
type Style struct {
// contains filtered or unexported fields
}
Style is a styled component.
func (Style) Inherit ¶
Inherit returns a copy of the original style with the properties from another style inherited. This follows lipgloss's inheritance behavior so margins, padding, and underlying string values are not inherited.
func (Style) InheritLipgloss ¶
Inherit returns a copy of the original style with the properties from a lipgloss.Style inherited. This follows lipgloss's inheritance behavior so margins, padding, and underlying string values are not inherited.
func (Style) Print ¶
Print applies the style to the specified text and prints it to the output writer.
func (Style) Printf ¶
Printf formats the specified text with the style applied and prints it to the output writer.
func (Style) WithOutput ¶
WithOutput sets the output writer.
func (Style) WithString ¶
WithString returns a copy of the style with the string configured for the String() method.