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) 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) 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 = "toml" 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) // IsLegal whether the format meets the specifications Format(source []byte) (string, error) }
TargetText: 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 GetParseManage ¶
func NewTomlParse ¶
func NewTomlParse() Parse
func NewYanmlParse ¶
func NewYanmlParse() Parse
type TomlParse ¶
type TomlParse struct { }
func (*TomlParse) FusionWithTpl ¶
Fusion ...
Click to show internal directories.
Click to hide internal directories.