Documentation ¶
Index ¶
- Constants
- Variables
- func Load(ext string, data []byte, v interface{}) error
- func LoadFile(file string, v interface{}) error
- func LoadFromReader(ext string, reader io.Reader, v interface{}) error
- func MustLoadFile(file string, v interface{})
- func RegisterExtensionHandler(ext string, loader LoaderFunction)
- type LoaderFunction
Constants ¶
View Source
const DefaultExt = "json"
Variables ¶
View Source
var Extensions = make(map[string]LoaderFunction)
Functions ¶
func LoadFromReader ¶ added in v1.2.0
指定扩展名和Reader,加载配置
func RegisterExtensionHandler ¶
func RegisterExtensionHandler(ext string, loader LoaderFunction)
注册文件扩展名对应的解析器
Types ¶
type LoaderFunction ¶
Click to show internal directories.
Click to hide internal directories.