Documentation ¶
Index ¶
- Constants
- func CombineConfigurations(configs map[string]interface{}) map[string]interface{}
- func FileSupported(path string) bool
- func Format(configurations map[string]interface{}) (string, error)
- func FormatCombined(configurations map[string]interface{}) (string, error)
- func ParseConfigurations(files []string) (map[string]interface{}, error)
- func ParseConfigurationsAs(files []string, parser string) (map[string]interface{}, error)
- func Parsers() []string
- type Parser
Constants ¶
const ( TOML = "toml" HCL1 = "hcl1" HCL2 = "hcl2" CUE = "cue" INI = "ini" HOCON = "hocon" Dockerfile = "dockerfile" YAML = "yaml" JSON = "json" JSONNET = "jsonnet" EDN = "edn" VCL = "vcl" XML = "xml" IGNORE = "ignore" )
The defined parsers are the parsers that are valid for parsing files.
Variables ¶
This section is empty.
Functions ¶
func CombineConfigurations ¶ added in v0.22.0
CombineConfigurations takes the given configurations and combines them into a single configuration. The result will be a map that contains a single key with a value of Combined.
func FileSupported ¶ added in v0.22.0
FileSupported returns true if the file at the given path is a file that can be parsed.
func Format ¶ added in v0.22.0
Format takes in multiple configurations input and formats the configuration to be more human readable. The key of each configuration should be its filepath.
func FormatCombined ¶ added in v0.22.0
FormatCombined takes in multiple configurations, combines them, and formats the configuration to be more human readable. The key of each configuration should be its filepath.
func ParseConfigurations ¶ added in v0.22.0
ParseConfigurations parses and returns the configurations from the given list of files. The result will be a map where the key is the file name of the configuration.
func ParseConfigurationsAs ¶ added in v0.22.0
ParseConfigurationsAs parses the files as the given file type and returns the configurations given in the file list. The result will be a map where the key is the file name of the configuration.
Types ¶
type Parser ¶
Parser defines all of the methods that every parser definition must implement.
func NewFromPath ¶ added in v0.22.0
NewFromPath returns a file parser based on the file type that exists at the given path.