Documentation
¶
Index ¶
Constants ¶
View Source
const BasicFormatterType string = "basic"
Variables ¶
This section is empty.
Functions ¶
func ConfigureFeaturesFromConfig ¶
func ConfigureFeaturesFromConfig(config *Config) yamlfmt.FeatureList
Types ¶
type BasicFormatter ¶
type BasicFormatter struct {
Config *Config
Features yamlfmt.FeatureList
YAMLFeatures YAMLFeatureList
}
func (*BasicFormatter) Type ¶
func (f *BasicFormatter) Type() string
type BasicFormatterError ¶
type BasicFormatterError struct {
// contains filtered or unexported fields
}
func (BasicFormatterError) Error ¶
func (e BasicFormatterError) Error() string
func (BasicFormatterError) Unwrap ¶
func (e BasicFormatterError) Unwrap() error
type BasicFormatterFactory ¶
type BasicFormatterFactory struct{}
func (*BasicFormatterFactory) NewFormatter ¶
func (f *BasicFormatterFactory) NewFormatter(configData map[string]interface{}) (yamlfmt.Formatter, error)
func (*BasicFormatterFactory) Type ¶
func (f *BasicFormatterFactory) Type() string
type Config ¶
type Config struct {
Indent int `mapstructure:"indent"`
IncludeDocumentStart bool `mapstructure:"include_document_start"`
LineEnding yamlfmt.LineBreakStyle `mapstructure:"line_ending"`
LineLength int `mapstructure:"max_line_length"`
RetainLineBreaks bool `mapstructure:"retain_line_breaks"`
RetainLineBreaksSingle bool `mapstructure:"retain_line_breaks_single"`
DisallowAnchors bool `mapstructure:"disallow_anchors"`
ScanFoldedAsLiteral bool `mapstructure:"scan_folded_as_literal"`
IndentlessArrays bool `mapstructure:"indentless_arrays"`
DropMergeTag bool `mapstructure:"drop_merge_tag"`
PadLineComments int `mapstructure:"pad_line_comments"`
TrimTrailingWhitespace bool `mapstructure:"trim_trailing_whitespace"`
EOFNewline bool `mapstructure:"eof_newline"`
ExpandShortLists bool `mapstructure:"expand_short_lists"`
StripStringQuotes bool `mapstructure:"strip_string_quotes"`
}
func DefaultConfig ¶
func DefaultConfig() *Config
type YAMLFeatureFunc ¶
These features will directly use the `yaml.Node` type and as such are specific to this formatter.
type YAMLFeatureList ¶
type YAMLFeatureList []YAMLFeatureFunc
func ConfigureYAMLFeaturesFromConfig ¶
func ConfigureYAMLFeaturesFromConfig(config *Config) YAMLFeatureList
func (YAMLFeatureList) ApplyFeatures ¶
func (y YAMLFeatureList) ApplyFeatures(node yaml.Node) error
Click to show internal directories.
Click to hide internal directories.