render

package
v0.0.0-...-ace8f63 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Empty

func Empty(RenderContext) error

func Indentation

func Indentation(ctx RenderContext) error

func NewLine

func NewLine(ctx RenderContext) error

func Space

func Space(ctx RenderContext) error

Types

type LiteralTypes

type LiteralTypes interface {
	bool | string | constraints.Float | constraints.Integer
}

type RenderContext

type RenderContext struct {
	Out         io.Writer
	IndentWith  string
	IndentDepth int
}

type Renderer

type Renderer = func(ctx RenderContext) error

func AllFrom

func AllFrom(rs seqs.Seq[Renderer]) Renderer

func AllOf

func AllOf(rs ...Renderer) Renderer

func ArrowMap

func ArrowMap(v map[string]string, keyRenderer func(string) Renderer, valueRenderer func(string) Renderer) Renderer

ArrowMap renders a map as a key=>value style map used at various places of the config grammar

func Error

func Error(err error) Renderer

func Formatted

func Formatted(format string, args ...any) Renderer

func If

func If(cond bool, r Renderer) Renderer

func Indented

func Indented(r Renderer) Renderer

func Line

func Line(r Renderer) Renderer

func Literal

func Literal[T LiteralTypes](v T) Renderer

func Quoted

func Quoted(s string) Renderer

func SpaceSeparated

func SpaceSeparated(rs ...Renderer) Renderer

func String

func String(s string) Renderer

func StringList

func StringList(stringList []string) Renderer

Jump to

Keyboard shortcuts

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