Refine Comments : admin/profile.go,bean/mock.go,config/global.go... (#5009)
* Refine Comments * refine comments for cache.go * refine comments for log.go * Update orm.go * refine comments for orm_log.go,types.go * Update utils.go * Update doc.go
This commit is contained in:
@@ -144,7 +144,7 @@ func avg(items []time.Duration) time.Duration {
|
||||
return time.Duration(int64(sum) / int64(len(items)))
|
||||
}
|
||||
|
||||
// format bytes number friendly
|
||||
// toH format bytes number friendly
|
||||
func toH(bytes uint64) string {
|
||||
switch {
|
||||
case bytes < 1024:
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// the mock object must be pointer of struct
|
||||
// Mock have a mock object ,it must be pointer of struct
|
||||
// the element in mock object can be slices, structures, basic data types, pointers and interface
|
||||
func Mock(v interface{}) (err error) {
|
||||
pv := reflect.ValueOf(v)
|
||||
|
||||
@@ -28,17 +28,17 @@ func InitGlobalInstance(name string, cfg string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// support section::key type in given key when using ini type.
|
||||
// Set support section::key type in given key when using ini type.
|
||||
func Set(key, val string) error {
|
||||
return globalInstance.Set(key, val)
|
||||
}
|
||||
|
||||
// support section::key type in key string when using ini and json type; Int,Int64,Bool,Float,DIY are same.
|
||||
// String support section::key type in key string when using ini and json type; Int,Int64,Bool,Float,DIY are same.
|
||||
func String(key string) (string, error) {
|
||||
return globalInstance.String(key)
|
||||
}
|
||||
|
||||
// get string slice
|
||||
// Strings will get string slice
|
||||
func Strings(key string) ([]string, error) {
|
||||
return globalInstance.Strings(key)
|
||||
}
|
||||
@@ -59,12 +59,12 @@ func Float(key string) (float64, error) {
|
||||
return globalInstance.Float(key)
|
||||
}
|
||||
|
||||
// support section::key type in key string when using ini and json type; Int,Int64,Bool,Float,DIY are same.
|
||||
// DefaultString support section::key type in key string when using ini and json type; Int,Int64,Bool,Float,DIY are same.
|
||||
func DefaultString(key string, defaultVal string) string {
|
||||
return globalInstance.DefaultString(key, defaultVal)
|
||||
}
|
||||
|
||||
// get string slice
|
||||
// DefaultStrings will get string slice
|
||||
func DefaultStrings(key string, defaultVal []string) []string {
|
||||
return globalInstance.DefaultStrings(key, defaultVal)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user