Documentation ¶
Index ¶
- Constants
- func Init()
- type Item
- type Parse
- type TomlParse
- func (tp *TomlParse) Convert(text string) (res []byte, err error)
- func (tp *TomlParse) Format(source []byte) (out string, err error)
- func (tp *TomlParse) FormatStrict(source []byte) (out string, err error)
- func (tp *TomlParse) Fusion(sources []string) (out string, err error)
- func (tp *TomlParse) FusionWithTpl(source string, texts []string) (out string, err error)
- func (tp *TomlParse) IsLegal(source []byte) (res bool, err error)
- type YamlParse
- func (tp *YamlParse) Convert(text string) (res []byte, err error)
- func (tp *YamlParse) Format(source []byte) (out string, err error)
- func (tp *YamlParse) FormatStrict(source []byte) (out string, err error)
- func (tp *YamlParse) Fusion(sources []string) (out string, err error)
- func (tp *YamlParse) FusionWithTpl(source string, texts []string) (out string, err error)
- func (tp *YamlParse) IsLegal(source []byte) (res bool, err error)
- func (tp *YamlParse) ParseItem(source []byte) (res []*Item, err error)
Constants ¶
View Source
const ( // TypToml .. TypToml = "toml" // TypYaml .. TypYaml = "yaml" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Parse ¶
type Parse interface { // Convert the json data stored in the template to the target format Convert(text string) ([]byte, error) // Fusion Multi-configuration data fusion Fusion(sources []string) (string, error) // FusionWithTpl Config combine with json FusionWithTpl(sources string, texts []string) (string, error) // Format Format(source []byte) (string, error) // IsLegal whether the format meets the specifications IsLegal(source []byte) (bool, error) // FormatStrict Custom strict analysis FormatStrict(source []byte) (string, error) }
Parse toml、yaml、ini, Configuration files stored in the database Different types of configurations have their own parser Json -> typ, merge with the original configuration file, and then return
func NewYanmlParse ¶
func NewYanmlParse() Parse
type TomlParse ¶
type TomlParse struct { }
TomlParse ..
func (*TomlParse) FormatStrict ¶
FormatStrict ..
func (*TomlParse) FusionWithTpl ¶
FusionWithTpl ...
type YamlParse ¶
type YamlParse struct { }
func (*YamlParse) FormatStrict ¶
FormatStrict ..
func (*YamlParse) FusionWithTpl ¶
Fusion ...
Click to show internal directories.
Click to hide internal directories.