Documentation ¶
Overview ¶
yeego 调试接口,格式化打印数据
yeego test辅助函数,用来快速判断是否相等
Index ¶
- Variables
- func Equal(get interface{}, expect interface{}, params ...interface{})
- func GetCurrentPath(dirPath string) string
- func InitEmptyConfig()
- func MustInitConfig(filePath string, fileName string)
- func NotEqual(get interface{}, expect interface{})
- func OK(input interface{}, params ...interface{})
- func Print(objList ...interface{})
- func SimpleColorPrint(objList ...interface{})
- func Sprint(objList ...interface{}) string
- func WatchConfig()
- type Json
- func (j *Json) ArrayIndex(index int) string
- func (j *Json) Get(key string) *Json
- func (j *Json) GetData() map[string]interface{}
- func (j *Json) GetIndex(index int) *Json
- func (j *Json) GetKey(key string, index int) *Json
- func (j *Json) GetPath(args ...string) *Json
- func (j *Json) StringToArray() (data []string)
- func (j *Json) ToArray() (k, v []string)
- func (j *Json) ToData() interface{}
- func (j *Json) ToFloat() float64
- func (j *Json) ToInt() int
- func (j *Json) ToSlice() []interface{}
- func (j *Json) ToString() string
Constants ¶
This section is empty.
Variables ¶
View Source
var Config configType
Functions ¶
func Equal ¶
func Equal(get interface{}, expect interface{}, params ...interface{})
Equal get和expect是否相同,不同则panic
func GetCurrentPath ¶
GetCurrentPath 获取项目路径下面的一些目录,不存在直接panic
func InitEmptyConfig ¶
func InitEmptyConfig()
func MustInitConfig ¶
func SimpleColorPrint ¶
func SimpleColorPrint(objList ...interface{})
SimpleColorPrint 简单的带颜色输出到stdout
func WatchConfig ¶
func WatchConfig()
Types ¶
type Json ¶
type Json struct {
Data interface{}
}
Json 接口类型,可以包含全部东西
func (*Json) ArrayIndex ¶
ArrayIndex return string index of json; json data type must be []interface{}
func (*Json) GetIndex ¶
GetIndex return Json of index n; warning that index is no unique 如果data是切片,获取地index个元素 如果data是map,获取key为index的数据
func (*Json) GetKey ¶
GetKey return json of arr and key; json data type must be [](map[string]interface{}) data必须是map[string]interface{}类型的切片
func (*Json) StringToArray ¶
Directories ¶
Path | Synopsis |
---|---|
third
|
|
Package validation for validations import ( "github.com/astaxie/beego/validation" "log" ) type User struct { Name string Age int } func main() { u := User{"man", 40} valid := validation.Validation{} valid.Required(u.Name, "name") valid.MaxSize(u.Name, 15, "nameMax") valid.Range(u.Age, 0, 140, "age") if valid.HasErrors() { // validation does not pass // print invalid message for _, err := range valid.Errors { log.Println(err.Key, err.Message) } } // or use like this if v := valid.Max(u.Age, 140, "ageMax"); !v.Ok { log.Println(v.Error.Key, v.Error.Message) } } more info: http://beego.me/docs/mvc/controller/validation.md
|
Package validation for validations import ( "github.com/astaxie/beego/validation" "log" ) type User struct { Name string Age int } func main() { u := User{"man", 40} valid := validation.Validation{} valid.Required(u.Name, "name") valid.MaxSize(u.Name, 15, "nameMax") valid.Range(u.Age, 0, 140, "age") if valid.HasErrors() { // validation does not pass // print invalid message for _, err := range valid.Errors { log.Println(err.Key, err.Message) } } // or use like this if v := valid.Max(u.Age, 140, "ageMax"); !v.Ok { log.Println(v.Error.Key, v.Error.Message) } } more info: http://beego.me/docs/mvc/controller/validation.md |
yeeCache 文件缓存类 yeeCache 内存缓存类
|
yeeCache 文件缓存类 yeeCache 内存缓存类 |
yeeCrypto 用于hash加密的包 依赖: "golang.org/x/crypto/bcrypt"
|
yeeCrypto 用于hash加密的包 依赖: "golang.org/x/crypto/bcrypt" |
file 文件处理相关函数
|
file 文件处理相关函数 |
reflect 对反射做一些封装,获取结构体的相关信息
|
reflect 对反射做一些封装,获取结构体的相关信息 |
* * Created by angelina-zf on 17/2/27.
|
* * Created by angelina-zf on 17/2/27. |
Click to show internal directories.
Click to hide internal directories.