Documentation ¶
Index ¶
- Constants
- Variables
- func BytesToString(b []byte) string
- func Contain(obj interface{}, target interface{}) bool
- func CurrentTime() string
- func CurrentTimestamp() int64
- func DBPage(number, size int) (limit int, offset int)
- func ExecBashShell(cmdLine string) (string, error)
- func Float64ToStr(x float64) string
- func GetRootPath() (*string, error)
- func GetShellTimezone() (int, error)
- func GetTimeZone() int
- func GetTimeZoneCity(num int) string
- func Int64ToStr(x int64) string
- func IntToStr(x int) string
- func MathChangeUnit(unit int64) string
- func NetMask16to10(str string) string
- func OneMonth(year int, month int) (int, time.Duration)
- func ParseJsonFile(filename string, v interface{}) error
- func PasswordEncryption(username string, password string, createAt int64) (string, error)
- func RandInt(x int) int
- func RandRangeInt(min, max int) int
- func RandStr() string
- func ReturnJson(o interface{}) string
- func SetLinuxSystemTime(tt int64) error
- func SetLinuxTimeZone(tz int) error
- func StrMD5(str string) string
- func StrSHA1(str string) string
- func StrSHA256(str string) string
- func StrSHA512(str string) string
- func StrToInt(x string) (int, error)
- func TimeDifference(oldTime, newTime string) int
- func TimestampToLocal(t int64) string
Constants ¶
View Source
const ( ZeroTime = time.Second * 0 OneSecond = time.Second * 1 OneMinute = OneSecond * 60 OneHour = OneMinute * 60 OneDay = OneHour * 24 OneWeek = OneDay * 7 OneYear = OneDay * 365 )
当前页面,都是时间类型(time.Duration)的值,不做其他用途
Variables ¶
View Source
var Validate validator
Functions ¶
func Contain ¶
func Contain(obj interface{}, target interface{}) bool
判断obj是否在target中,target支持的类型 array, slice, map
func Float64ToStr ¶
func Int64ToStr ¶
func ParseJsonFile ¶
解析JSON文件: json文件的数据结构 和 接口对象的数据结构 必须要一致!!!
func PasswordEncryption ¶
给密码加密,这里推荐使用用户ID。后面有空的时候我会更新一下。 这种方式加密的弊端是用户名不能修改了,否则就无法登录了。正常的用法是使用用户ID
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.