Documentation ¶
Index ¶
- Constants
- type ColorizedOutput
- func (ColorizedOutput) Assignment(ctx context.Context, assignment *ast.Assignment, settings Settings) *Lines
- func (ColorizedOutput) Comment(ctx context.Context, comment *ast.Comment, settings Settings) *Lines
- func (ColorizedOutput) GroupBanner(ctx context.Context, group *ast.Group, settings Settings) *Lines
- func (ColorizedOutput) Newline(ctx context.Context, newline *ast.Newline, settings Settings) *Lines
- type CompletionOutputKeys
- func (CompletionOutputKeys) Assignment(ctx context.Context, assignment *ast.Assignment, settings Settings) *Lines
- func (r CompletionOutputKeys) Comment(ctx context.Context, comment *ast.Comment, settings Settings) *Lines
- func (CompletionOutputKeys) GroupBanner(ctx context.Context, group *ast.Group, settings Settings) *Lines
- func (r CompletionOutputKeys) Newline(ctx context.Context, 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(ctx context.Context, assignment *ast.Assignment, settings Settings) *Lines
- func (r PlainOutput) Comment(ctx context.Context, comment *ast.Comment, settings Settings) *Lines
- func (PlainOutput) GroupBanner(ctx context.Context, group *ast.Group, settings Settings) *Lines
- func (r PlainOutput) Newline(ctx context.Context, 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 WithExport(boolean 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 ¶
This section is empty.
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(ctx context.Context, assignment *ast.Assignment, settings Settings) *Lines
func (ColorizedOutput) GroupBanner ¶ added in v0.3.0
type CompletionOutputKeys ¶ added in v0.6.1
type CompletionOutputKeys struct{}
func (CompletionOutputKeys) Assignment ¶ added in v0.6.1
func (CompletionOutputKeys) Assignment(ctx context.Context, assignment *ast.Assignment, settings Settings) *Lines
func (CompletionOutputKeys) GroupBanner ¶ added in v0.6.1
type Handler ¶
type Handler func(ctx context.Context, hi *HandlerInput) HandlerSignal
func NewAstSelectorHandler ¶ added in v0.9.0
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(ctx context.Context, 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 Output ¶ added in v0.3.0
type Output interface { GroupBanner(ctx context.Context, group *ast.Group, settings Settings) *Lines Assignment(ctx context.Context, assignment *ast.Assignment, settings Settings) *Lines Comment(ctx context.Context, comment *ast.Comment, settings Settings) *Lines Newline(ctx context.Context, newline *ast.Newline, settings Settings) *Lines }
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(ctx context.Context, assignment *ast.Assignment, settings Settings) *Lines
func (PlainOutput) GroupBanner ¶ added in v0.3.0
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 InterpolatedValues 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 WithExport ¶ added in v0.11.1
func WithExport(boolean 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.