Documentation
¶
Index ¶
- func Certificates(certificates []*assets.Certificate) string
- func FormatNumber(n int64) string
- func Hosts(hosts []*assets.Host) string
- func SearchHits(hits []assets.Asset) string
- func Section(title string, f func(*Block)) string
- func Separator() string
- func SeparatorWithLabel(label string) string
- func Val[T any](p *T, zero T) T
- func WebProperties(webProperties []*assets.WebProperty) string
- type Block
- func (b *Block) EndItem()
- func (b *Block) Field(k, v string)
- func (b *Block) Fieldf(k, format string, args ...any)
- func (b *Block) Fields(m map[string]string)
- func (b *Block) Item(title string)
- func (b *Block) ItemField(k, v string)
- func (b *Block) Newline()
- func (b *Block) Separator()
- func (b *Block) SeparatorWithLabel(label string)
- func (b *Block) String() string
- func (b *Block) Title(t string)
- func (b *Block) Write(content string)
- func (b *Block) WriteLine(content string)
- type BlockOption
- type Line
- type LineOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Certificates ¶
func Certificates(certificates []*assets.Certificate) string
Certificates renders certificates in short format
func FormatNumber ¶
FormatNumber formats an int64 with comma separators.
func SearchHits ¶
SearchHits renders search hits in short format. Renders hits in the order received, adding numbered separators with asset type.
func Section ¶
Section is a convenience function that creates a block with a title and applies a function to it.
func SeparatorWithLabel ¶
SeparatorWithLabel returns a separator with a centered label (e.g., "--- Host #1 ---")
func Val ¶
func Val[T any](p *T, zero T) T
Val returns the value of a pointer, or the zero value if the pointer is nil
func WebProperties ¶
func WebProperties(webProperties []*assets.WebProperty) string
WebProperties renders web properties in short format
Types ¶
type Block ¶
type Block struct {
// contains filtered or unexported fields
}
func NewBlock ¶
func NewBlock(opts ...BlockOption) *Block
func (*Block) Field ¶
Field writes a key-value pair to the block with proper indentation and styling. Automatically skips empty values.
func (*Block) Fieldf ¶
Fieldf writes a formatted key-value pair to the block with proper indentation and styling. Automatically skips empty values.
func (*Block) Item ¶
Item starts a new list item with a hyphen prefix. The title can be raw text or already-styled text.
func (*Block) ItemField ¶
ItemField writes a key-value pair indented under the current item. Automatically skips empty values.
func (*Block) Separator ¶
func (b *Block) Separator()
Separator writes a standard separator line to the block.
func (*Block) SeparatorWithLabel ¶
SeparatorWithLabel writes a separator with a label to the block.
type BlockOption ¶
type BlockOption func(*Block)
func WithIndent ¶
func WithIndent(n int) BlockOption
func WithKeyStyle ¶
func WithKeyStyle(style lipgloss.Style) BlockOption
func WithValueStyle ¶
func WithValueStyle(style lipgloss.Style) BlockOption
type Line ¶
type Line struct {
// contains filtered or unexported fields
}
func NewLine ¶
func NewLine(opts ...LineOption) *Line
func (*Line) WriteInline ¶
WriteInline writes a label and value without a trailing newline.
type LineOption ¶
type LineOption func(*Line)
func WithLabelStyle ¶
func WithLabelStyle(style lipgloss.Style) LineOption
func WithLineValueStyle ¶
func WithLineValueStyle(style lipgloss.Style) LineOption