Documentation
¶
Index ¶
- Constants
- type Colorized
- func (c Colorized) Assignment(a *ast.Assignment, settings Settings) string
- func (r Colorized) Comment(comment *ast.Comment, settings Settings, isAssignmentComment bool) string
- func (c Colorized) Group(group *ast.Group, settings Settings) string
- func (r Colorized) Newline(newline *ast.Newline, settings Settings) string
- type Handler
- type HandlerInput
- type LineBuffer
- type Outputter
- type Plain
- func (c Plain) Assignment(a *ast.Assignment, settings Settings) string
- func (r Plain) Comment(comment *ast.Comment, settings Settings, isAssignmentComment bool) string
- func (c Plain) Group(group *ast.Group, settings Settings) string
- func (r Plain) Newline(newline *ast.Newline, settings Settings) string
- type Renderer
- func (r *Renderer) Assignment(a *ast.Assignment) string
- func (r *Renderer) Comment(comment *ast.Comment, isAssignmentComment bool) string
- func (r *Renderer) Document(doc *ast.Document) string
- func (r *Renderer) Group(group *ast.Group) string
- func (r *Renderer) Newline(newline *ast.Newline) string
- func (r *Renderer) SetOutput(output Outputter)
- func (r *Renderer) Statement(stmt any) string
- type Settings
- type Signal
Constants ¶
View Source
const Newline = "\n"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Colorized ¶
type Colorized struct{}
func (Colorized) Assignment ¶
func (c Colorized) Assignment(a *ast.Assignment, settings Settings) string
type Handler ¶
type Handler func(in *HandlerInput) Signal
type HandlerInput ¶
type HandlerInput struct {
Presenter *Renderer
Previous ast.Statement
Settings Settings
Statement any
Value string
}
func (*HandlerInput) Continue ¶
func (si *HandlerInput) Continue() Signal
func (*HandlerInput) Return ¶
func (si *HandlerInput) Return(val string) Signal
func (*HandlerInput) Stop ¶
func (si *HandlerInput) Stop() Signal
type LineBuffer ¶
type LineBuffer struct {
// contains filtered or unexported fields
}
func (*LineBuffer) Add ¶
func (lb *LineBuffer) Add(str string) *LineBuffer
func (*LineBuffer) AddPrinted ¶
func (lb *LineBuffer) AddPrinted(str string) bool
func (*LineBuffer) EnsureEOF ¶
func (lb *LineBuffer) EnsureEOF() *LineBuffer
func (*LineBuffer) Get ¶
func (lb *LineBuffer) Get() string
func (*LineBuffer) GetWithEOF ¶
func (lb *LineBuffer) GetWithEOF() string
func (*LineBuffer) Newline ¶
func (lb *LineBuffer) Newline() *LineBuffer
type Plain ¶
type Plain struct{}
func (Plain) Assignment ¶
func (c Plain) Assignment(a *ast.Assignment, settings Settings) string
type Renderer ¶
type Renderer struct {
Output Outputter
Previous ast.Statement
Settings Settings
// contains filtered or unexported fields
}
func NewFormatter ¶
func NewFormatter() *Renderer
func NewRenderer ¶
func (*Renderer) Assignment ¶
func (r *Renderer) Assignment(a *ast.Assignment) string
type Settings ¶
type Settings struct {
FilterKeyPrefix string
FilterGroup string
IncludeCommented bool
ShowBlankLines bool
ShowColors bool
ShowComments bool
ShowGroups bool
ShowPretty bool
Interpolate bool
}
func (*Settings) WithBlankLines ¶
func (*Settings) WithColors ¶
func (*Settings) WithComments ¶
func (*Settings) WithGroups ¶
Click to show internal directories.
Click to hide internal directories.