Documentation ¶
Overview ¶
util.go
Index ¶
- func CmdRunWithTimeout(cmd *exec.Cmd, timeout time.Duration) (error, bool)
- func ConvertBase64ToImage(content string, imagePath, prefixURI string) (string, error)
- func DelFile(files []os.FileInfo, count int, fileDir string)
- func Exec(bin string, args ...string) (string, error)
- func ExecWithTimeout(bin string, timeout time.Duration, args ...string) (string, error)
- func FileGetContent(file string) (string, error)
- func FileMTime(file string) (int64, error)
- func FilePutContent(file string, content string) (int, error)
- func FileSize(file string) (int64, error)
- func GetInt16Str(d int16) string
- func GetInt32Str(d int32) string
- func GetInt64Str(d int64) string
- func GetInt8Str(d int8) string
- func GetIntStr(d int) string
- func GetIpMask(start, end string) string
- func GetStrBool(strv string, def ...bool) (bool, error)
- func GetStrFloat(strv string, def ...float64) (float64, error)
- func GetStrFloat64(strv string, def ...float64) (float64, error)
- func GetStrInt(strv string, def ...int) (int, error)
- func GetStrInt16(strv string, def ...int16) (int16, error)
- func GetStrInt32(strv string, def ...int32) (int32, error)
- func GetStrInt64(strv string, def ...int64) (int64, error)
- func GetStrInt8(strv string, def ...int8) (int8, error)
- func GetStrUint(strv string, def ...uint) (uint, error)
- func GetStrUint16(strv string, def ...uint16) (uint16, error)
- func GetStrUint32(strv string, def ...uint32) (uint32, error)
- func GetStrUint64(strv string, def ...uint64) (uint64, error)
- func GetStrUint8(strv string, def ...uint8) (uint8, error)
- func GetTimeAgo(t int64) (s string)
- func GetUint16Str(d uint16) string
- func GetUint32Str(d uint32) string
- func GetUint64Str(d uint64) string
- func GetUint8Str(d uint8) string
- func GetUintStr(d uint) string
- func Ip2long(ipstr string) (ip uint32)
- func IsExist(path string) bool
- func IsFile(file string) bool
- func IsImage(extName string) bool
- func IsPrivateIP(ip string) bool
- func Long2ip(ip uint32) string
- func Mkdir(src string) error
- func RandomCreateBytes(n int, alphabets ...byte) []byte
- func Remove(file string) error
- func RemoveAll(path string) error
- func Rename(file string, to string) error
- func Substr(s string, start, length int) string
- func WebTime(t time.Time) string
- type FileRepos
- type IpNetmask
- type Mail
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertBase64ToImage ¶ added in v1.2.0
转换base64为图片链接
func ExecWithTimeout ¶
func FilePutContent ¶
put string to file
func GetInt16Str ¶ added in v1.2.0
func GetInt32Str ¶ added in v1.2.0
func GetInt64Str ¶
func GetInt8Str ¶ added in v1.2.0
func GetTimeAgo ¶
func GetUint16Str ¶ added in v1.2.0
func GetUint32Str ¶ added in v1.2.0
func GetUint64Str ¶
func GetUint8Str ¶ added in v1.2.0
func GetUintStr ¶
func RandomCreateBytes ¶ added in v1.2.0
RandomCreateBytes generate random []byte by specify chars.
Types ¶
type FileRepos ¶
type FileRepos []Repository
type IpNetmask ¶
type Mail ¶ added in v1.2.0
type Mail struct {
// contains filtered or unexported fields
}
func (*Mail) SendEmailDaemon ¶ added in v1.2.0
func (m *Mail) SendEmailDaemon()
func (*Mail) SendEmailOnce ¶ added in v1.2.0
func (*Mail) SetMessage ¶ added in v1.2.0
type Repository ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.