Documentation ¶
Index ¶
- Constants
- Variables
- type ColorizedOutput
- func (ColorizedOutput) Assignment(assignment *ast.Assignment, settings Settings) *Lines
- func (ColorizedOutput) Comment(comment *ast.Comment, settings Settings) *Lines
- func (ColorizedOutput) GroupBanner(group *ast.Group, settings Settings) *Lines
- func (ColorizedOutput) Newline(newline *ast.Newline, settings Settings) *Lines
- type CompletionOutputKeys
- func (CompletionOutputKeys) Assignment(a *ast.Assignment, settings Settings) *Lines
- func (r CompletionOutputKeys) Comment(comment *ast.Comment, settings Settings) *Lines
- func (CompletionOutputKeys) GroupBanner(group *ast.Group, settings Settings) *Lines
- func (r CompletionOutputKeys) Newline(newline *ast.Newline, settings Settings) *Lines
- type Handler
- type HandlerInput
- type HandlerSignal
- type Line
- type Lines
- type Output
- type OutputType
- type PlainOutput
- func (PlainOutput) Assignment(assignment *ast.Assignment, settings Settings) *Lines
- func (r PlainOutput) Comment(comment *ast.Comment, settings Settings) *Lines
- func (PlainOutput) GroupBanner(group *ast.Group, settings Settings) *Lines
- func (r PlainOutput) Newline(newline *ast.Newline, settings Settings) *Lines
- type Renderer
- type Settings
- type SettingsOption
- func WithBlankLines(b bool) SettingsOption
- func WithColors(b bool) SettingsOption
- func WithComments(b bool) SettingsOption
- func WithFilterGroup(name string) SettingsOption
- func WithFilterKeyPrefix(prefix string) SettingsOption
- func WithFormattedOutput(boolean bool) SettingsOption
- func WithGroupBanners(b bool) SettingsOption
- func WithIncludeDisabled(b bool) SettingsOption
- func WithInterpolation(b bool) SettingsOption
- func WithOutputType(t OutputType) SettingsOption
- func WithOutputter(o Output) SettingsOption
Constants ¶
View Source
const Newline = "\n"
Variables ¶
View Source
var ( ExcludeComments = newSelectorHandler(ast.ExcludeComments) ExcludeDisabledAssignments = newSelectorHandler(ast.ExcludeDisabledAssignments) ExcludeActiveAssignments = newSelectorHandler(ast.ExcludeActiveAssignments) ExcludeHiddenViaAnnotation = newSelectorHandler(ast.ExcludeHiddenViaAnnotation) )
Functions ¶
This section is empty.
Types ¶
type ColorizedOutput ¶ added in v0.3.0
type ColorizedOutput struct{}
func (ColorizedOutput) Assignment ¶ added in v0.3.0
func (ColorizedOutput) Assignment(assignment *ast.Assignment, settings Settings) *Lines
func (ColorizedOutput) Comment ¶ added in v0.3.0
func (ColorizedOutput) Comment(comment *ast.Comment, settings Settings) *Lines
func (ColorizedOutput) GroupBanner ¶ added in v0.3.0
func (ColorizedOutput) GroupBanner(group *ast.Group, settings Settings) *Lines
type CompletionOutputKeys ¶ added in v0.6.1
type CompletionOutputKeys struct{}
func (CompletionOutputKeys) Assignment ¶ added in v0.6.1
func (CompletionOutputKeys) Assignment(a *ast.Assignment, settings Settings) *Lines
func (CompletionOutputKeys) Comment ¶ added in v0.6.1
func (r CompletionOutputKeys) Comment(comment *ast.Comment, settings Settings) *Lines
func (CompletionOutputKeys) GroupBanner ¶ added in v0.6.1
func (CompletionOutputKeys) GroupBanner(group *ast.Group, settings Settings) *Lines
type Handler ¶
type Handler func(hi *HandlerInput) HandlerSignal
func ExcludeKeyPrefix ¶ added in v0.6.2
func RetainExactKey ¶ added in v0.6.9
func RetainGroup ¶ added in v0.6.2
func RetainKeyPrefix ¶ added in v0.6.2
type HandlerInput ¶
type HandlerInput struct { CurrentStatement any PreviousStatement ast.Statement Renderer *Renderer ReturnValue *Lines Settings Settings }
func (*HandlerInput) Continue ¶
func (hi *HandlerInput) Continue() HandlerSignal
func (*HandlerInput) Return ¶
func (hi *HandlerInput) Return(value *Lines) HandlerSignal
func (*HandlerInput) Stop ¶
func (hi *HandlerInput) Stop() HandlerSignal
type HandlerSignal ¶ added in v0.3.0
type HandlerSignal uint
const ( Continue HandlerSignal = iota Stop Return )
func FormatterHandler ¶ added in v0.3.0
func FormatterHandler(input *HandlerInput) HandlerSignal
FormatterHandler is responsible for formatting an .env file according to our opinionated style.
func (HandlerSignal) String ¶ added in v0.3.0
func (hs HandlerSignal) String() string
String returns the string corresponding to the Handler Signal.
type Line ¶ added in v0.3.0
type Line struct { Literal string // The *real* value of the line being added Debug string // A debug value to help track where NewLines are coming from (use DEBUG=1 to see them when using --pretty) }
Line represents a line in an output
type Lines ¶ added in v0.3.0
type Lines struct {
// contains filtered or unexported fields
}
Lines is a collection of lines
func NewLinesCollection ¶ added in v0.3.0
func NewLinesCollection() *Lines
func (*Lines) Append ¶ added in v0.3.0
Append adds one Lines collection to the end of another if its's not empty
type OutputType ¶ added in v0.6.1
type OutputType uint
const ( Plain OutputType = iota Colorized CompletionKeyOnly )
type PlainOutput ¶ added in v0.3.0
type PlainOutput struct{}
func (PlainOutput) Assignment ¶ added in v0.3.0
func (PlainOutput) Assignment(assignment *ast.Assignment, settings Settings) *Lines
func (PlainOutput) Comment ¶ added in v0.3.0
func (r PlainOutput) Comment(comment *ast.Comment, settings Settings) *Lines
func (PlainOutput) GroupBanner ¶ added in v0.3.0
func (PlainOutput) GroupBanner(group *ast.Group, settings Settings) *Lines
type Renderer ¶
type Renderer struct { Output Output PreviousStatement ast.Statement Settings Settings // contains filtered or unexported fields }
func NewFormatter ¶
func NewFormatter() *Renderer
func NewRenderer ¶
func NewUnfilteredRenderer ¶ added in v0.6.1
type Settings ¶
type Settings struct { ShowGroupBanners bool // contains filtered or unexported fields }
func NewSettings ¶ added in v0.3.0
func NewSettings(options ...SettingsOption) *Settings
func (*Settings) Apply ¶ added in v0.3.0
func (s *Settings) Apply(options ...SettingsOption) *Settings
func (Settings) ShowBlankLines ¶
type SettingsOption ¶ added in v0.3.0
type SettingsOption func(*Settings)
func WithBlankLines ¶ added in v0.3.0
func WithBlankLines(b bool) SettingsOption
func WithColors ¶ added in v0.3.0
func WithColors(b bool) SettingsOption
func WithComments ¶ added in v0.3.0
func WithComments(b bool) SettingsOption
func WithFilterGroup ¶ added in v0.3.0
func WithFilterGroup(name string) SettingsOption
func WithFilterKeyPrefix ¶ added in v0.3.0
func WithFilterKeyPrefix(prefix string) SettingsOption
func WithFormattedOutput ¶ added in v0.3.0
func WithFormattedOutput(boolean bool) SettingsOption
func WithGroupBanners ¶ added in v0.3.0
func WithGroupBanners(b bool) SettingsOption
func WithIncludeDisabled ¶ added in v0.3.0
func WithIncludeDisabled(b bool) SettingsOption
func WithInterpolation ¶ added in v0.3.0
func WithInterpolation(b bool) SettingsOption
func WithOutputType ¶ added in v0.6.1
func WithOutputType(t OutputType) SettingsOption
func WithOutputter ¶ added in v0.6.1
func WithOutputter(o Output) SettingsOption
Click to show internal directories.
Click to hide internal directories.