short

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

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

func FormatNumber(n int64) string

FormatNumber formats an int64 with comma separators.

func Hosts

func Hosts(hosts []*assets.Host) string

Hosts renders hosts in short format.

func SearchHits

func SearchHits(hits []assets.Asset) string

SearchHits renders search hits in short format. Renders hits in the order received, adding numbered separators with asset type.

func Section

func Section(title string, f func(*Block)) string

Section is a convenience function that creates a block with a title and applies a function to it.

func Separator

func Separator() string

Separator is a standard separator line for short output

func SeparatorWithLabel

func SeparatorWithLabel(label string) string

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) EndItem

func (b *Block) EndItem()

EndItem closes the current item and adds spacing.

func (*Block) Field

func (b *Block) Field(k, v string)

Field writes a key-value pair to the block with proper indentation and styling. Automatically skips empty values.

func (*Block) Fieldf

func (b *Block) Fieldf(k, format string, args ...any)

Fieldf writes a formatted key-value pair to the block with proper indentation and styling. Automatically skips empty values.

func (*Block) Fields

func (b *Block) Fields(m map[string]string)

Fields writes multiple key-value pairs to the block.

func (*Block) Item

func (b *Block) Item(title string)

Item starts a new list item with a hyphen prefix. The title can be raw text or already-styled text.

func (*Block) ItemField

func (b *Block) ItemField(k, v string)

ItemField writes a key-value pair indented under the current item. Automatically skips empty values.

func (*Block) Newline

func (b *Block) Newline()

Newline writes a blank line to the block.

func (*Block) Separator

func (b *Block) Separator()

Separator writes a standard separator line to the block.

func (*Block) SeparatorWithLabel

func (b *Block) SeparatorWithLabel(label string)

SeparatorWithLabel writes a separator with a label to the block.

func (*Block) String

func (b *Block) String() string

func (*Block) Title

func (b *Block) Title(t string)

Title writes a section title to the block.

func (*Block) Write

func (b *Block) Write(content string)

func (*Block) WriteLine

func (b *Block) WriteLine(content string)

WriteLine writes content followed by a newline 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) Newline

func (l *Line) Newline()

func (*Line) String

func (l *Line) String() string

func (*Line) Write

func (l *Line) Write(label, value string)

func (*Line) WriteInline

func (l *Line) WriteInline(label, value string)

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

Jump to

Keyboard shortcuts

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