yamlutils

package
v0.0.0-...-f4d96fc Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatCommentAsPlainText

func FormatCommentAsPlainText(comment string) string

FormatCommentAsPlainText removes `#` characters from the comment and handles multiline whitespaces, returning a cleaned comment string.

Parameters:

  • comment: The comment string to format.

Returns:

  • string: The cleaned comment string.

func ReadYamlFilesFromDirectory

func ReadYamlFilesFromDirectory(filesystem afero.Fs, directory string) map[string][]byte

ReadYamlFilesFromDirectory reads all YAML files from the specified directory and returns a map where the keys are file paths and the values are the file contents.

Parameters:

  • filesystem: An interface for interacting with the file system.
  • directory: The directory from which to read YAML files.

Returns:

  • map[string][]byte: A map of file paths to their respective contents.

func RemoveYamlDocumentSeparators

func RemoveYamlDocumentSeparators(yamlContent []byte) []byte

RemoveYamlDocumentSeparators removes YAML document separators ("---" and "...") from the given YAML content.

Parameters:

  • yamlContent: The content of the YAML file.

Returns:

  • []byte: The cleaned YAML content without document separators.

Types

This section is empty.

Jump to

Keyboard shortcuts

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