Documentation
¶
Overview ¶
Package sourceview lays out the configuration source map as text. The dashboard's config map and `kranz config sources` both render through it, so the two surfaces cannot drift apart in layout, only in colour: the dashboard passes its theme styles, the CLI passes none and gets plain text.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByService ¶
ByService lists each effective service as one row, name and defining file, with the later override layers and their fields beneath it. Field paths drop the service name the row already carries.
func BySource ¶
BySource lists the resolved sources in deterministic order as the include tree. Every file is named by what it adds below its ancestors, so the tree reads without repeating their directories; `--output json` keeps the full paths. Merge order is the order of the rows, so no position number is drawn.
Types ¶
type Options ¶
type Options struct {
// Width is the number of cells every line must fit in.
Width int
Styles Styles
// Disabled reports whether a service is disabled; nil means none are.
Disabled func(service string) bool
}
Options configures one rendering.
type Styles ¶
type Styles struct {
// Muted draws tree rails, summaries, and source kinds.
Muted func(string) string
// Strong draws file names and service names.
Strong func(string) string
// Label draws detail row labels.
Label func(string) string
// Accent draws override layers, the sources that change behaviour.
Accent func(string) string
// Warning draws the truncated marker.
Warning func(string) string
// Disabled draws the name of a disabled service.
Disabled func(string) string
}
Styles colours the map. A nil field leaves that text plain.