prefix

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LEVEL_0 = iota
	LEVEL_1
	LEVEL_2
	LEVEL_3
)

Each level has 2 spaces for PrefixWriter

Variables

This section is empty.

Functions

func PrintAnnotationsMultiline

func PrintAnnotationsMultiline(level int, title, indent string, annotations map[string]string, w PrefixWriter)

outputAnnotationsMultilineWithIndent prints multiple annotations with a user-defined alignment. If annotation string is too long, we omit chars more than 140 length.

func PrintLabelsMultiline

func PrintLabelsMultiline(level int, title, indent string, labels map[string]string, w PrefixWriter)

printLabelsMultiline prints multiple labels with a user-defined alignment.

Types

type PrefixWriter

type PrefixWriter interface {
	// Write writes text with the specified indentation level.
	Write(level int, format string, a ...interface{})
	// WriteLine writes an entire line with no indentation level.
	WriteLine(a ...interface{})
	// Flush forces indentation to be reset.
	Flush()
}

PrefixWriter can write text at various indentation levels.

func NewPrefixWriter

func NewPrefixWriter() PrefixWriter

NewPrefixWriter creates a new PrefixWriter.

Jump to

Keyboard shortcuts

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