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 FormatJSON(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 ( CUE = "cue" CYCLONEDX = "cyclonedx" Dockerfile = "dockerfile" EDN = "edn" HCL1 = "hcl1" HCL2 = "hcl2" HOCON = "hocon" IGNORE = "ignore" INI = "ini" JSON = "json" JSONC = "jsonc" JSONNET = "jsonnet" PROPERTIES = "properties" SPDX = "spdx" TEXTPROTO = "textproto" TOML = "toml" VCL = "vcl" XML = "xml" YAML = "yaml" DOTENV = "dotenv" )
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 FormatJSON ¶ added in v0.31.0
FormatJSON takes in multiple configurations and formats them as a JSON object where each key is the path to the file and the contents are the parsed configurations.
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.
Directories ¶
Path | Synopsis |
---|---|
Package textproto provides an interface to parse Protocol Buffers in their textual format.
|
Package textproto provides an interface to parse Protocol Buffers in their textual format. |