add package gkvdb; add kvdb storage feature for ghttp.Server

This commit is contained in:
John
2019-08-22 21:04:30 +08:00
parent 51a156420d
commit 7dffd9d1ff
20 changed files with 795 additions and 113 deletions

View File

@ -73,6 +73,11 @@ func (j *Json) GetVar(pattern string, def ...interface{}) *gvar.Var {
return gvar.New(j.Get(pattern, def...))
}
// GetVars returns []*gvar.Var with value by given <pattern>.
func (j *Json) GetVars(pattern string, def ...interface{}) []*gvar.Var {
return gvar.New(j.Get(pattern, def...)).Vars()
}
// GetMap gets the value by specified <pattern>,
// and converts it to map[string]interface{}.
func (j *Json) GetMap(pattern string, def ...interface{}) map[string]interface{} {