parser

package
v0.0.0-...-a08c4ad Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type INIParser

type INIParser struct{}

INIParser handles INI configuration files.

func (*INIParser) Extensions

func (p *INIParser) Extensions() []string

func (*INIParser) Unmarshal

func (p *INIParser) Unmarshal(data []byte) (map[string]interface{}, error)

type JSONParser

type JSONParser struct{}

JSONParser handles JSON configuration files.

func (*JSONParser) Extensions

func (p *JSONParser) Extensions() []string

func (*JSONParser) Unmarshal

func (p *JSONParser) Unmarshal(data []byte) (map[string]interface{}, error)

type Parser

type Parser interface {
	// Extensions returns the list of file extensions (without the dot) that this parser handles.
	Extensions() []string
	// Unmarshal parses the given data into a nested map.
	Unmarshal(data []byte) (map[string]interface{}, error)
}

Parser defines the interface for configuration file parsers.

type PropertiesParser

type PropertiesParser struct{}

PropertiesParser handles .properties configuration files.

func (*PropertiesParser) Extensions

func (p *PropertiesParser) Extensions() []string

func (*PropertiesParser) Unmarshal

func (p *PropertiesParser) Unmarshal(data []byte) (map[string]interface{}, error)

type TOMLParser

type TOMLParser struct{}

TOMLParser handles TOML configuration files.

func (*TOMLParser) Extensions

func (p *TOMLParser) Extensions() []string

func (*TOMLParser) Unmarshal

func (p *TOMLParser) Unmarshal(data []byte) (map[string]interface{}, error)

type XMLParser

type XMLParser struct{}

XMLParser handles XML configuration files using the mxj library.

func (*XMLParser) Extensions

func (p *XMLParser) Extensions() []string

func (*XMLParser) Unmarshal

func (p *XMLParser) Unmarshal(data []byte) (map[string]interface{}, error)

type YAMLParser

type YAMLParser struct{}

YAMLParser handles YAML configuration files.

func (*YAMLParser) Extensions

func (p *YAMLParser) Extensions() []string

func (*YAMLParser) Unmarshal

func (p *YAMLParser) Unmarshal(data []byte) (map[string]interface{}, error)

Jump to

Keyboard shortcuts

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