mirror of
https://gitee.com/johng/gf.git
synced 2024-11-29 18:57:44 +08:00
新增环境变量管理工具genv,完善gmvc配置管理功能
This commit is contained in:
parent
6ee93e7414
commit
ef59098989
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017 john@johng.cn
|
||||
Copyright (c) 2017 john@johng.cn http://johng.cn
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -7,7 +7,7 @@ go get -u gitee.com/johng/gf
|
||||
|
||||
## 使用
|
||||
```go
|
||||
import "gitee.com/johng/gf/g/xxx"
|
||||
import "gitee.com/johng/gf/g/xxx/xxx"
|
||||
```
|
||||
|
||||
## 说明
|
||||
|
@ -103,6 +103,15 @@ func (p *Json) GetMap(pattern string) map[string]interface{} {
|
||||
return nil
|
||||
}
|
||||
|
||||
// 将检索值转换为Json对象指针返回
|
||||
func (p *Json) GetJson(pattern string) *Json {
|
||||
result := p.Get(pattern)
|
||||
if result != nil {
|
||||
return &Json{&result}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// 获得一个数组[]interface{},方便操作,不需要自己做类型转换
|
||||
// 注意,如果获取的值不存在,或者类型与json类型不匹配,那么将会返回nil
|
||||
func (p *Json) GetArray(pattern string) []interface{} {
|
||||
|
@ -3,14 +3,10 @@ package gbase
|
||||
|
||||
import (
|
||||
"gitee.com/johng/gf/g/os/gfile"
|
||||
"gitee.com/johng/gf/g/os/gconsole"
|
||||
"gitee.com/johng/gf/g/database/gdb"
|
||||
"gitee.com/johng/gf/g/frame/gconfig"
|
||||
"gitee.com/johng/gf/g/frame/ginstance"
|
||||
"gitee.com/johng/gf/g/os/gconsole"
|
||||
)
|
||||
|
||||
const (
|
||||
gDEFAULT_CONFIG_FILE = "config.json" // 默认读取的配置文件名称
|
||||
)
|
||||
|
||||
// 框架基类,所有的基于gf框架的类对象都继承于此,以便使用框架的一些封装的核心组件
|
||||
|
Loading…
Reference in New Issue
Block a user