utils

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2021 License: GPL-3.0 Imports: 21 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DateLayout      = "2006-01-02"
	DateTimeLayout  = "2006-01-02 15:04:05"
	BuildTimeLayout = "2006.0102.150405"
	TimestampLayout = "20060102150405"
)

Variables

View Source
var StartTime = time.Now()

Functions

func BytesToInt

func BytesToInt(b []byte) int

BytesToInt 字节转换成整形

func CWD

func CWD() string

func Conf

func Conf() *ini.File

func ConfFile

func ConfFile() string

func ConfFileDev

func ConfFileDev() string

func DBFile

func DBFile() string

func DBFileDev

func DBFileDev() string

func DataDir

func DataDir() string

func DeepCopy

func DeepCopy(dst, src interface{}) error

func EXEName

func EXEName() string

func Ellipsis

func Ellipsis(text string, length int) string

func EnsureDir

func EnsureDir(dir string) (err error)

func ErrorLogFilename

func ErrorLogFilename() string

func Exist

func Exist(path string) bool

func ExpandHomeDir

func ExpandHomeDir(path string) string

func HomeDir

func HomeDir() string

func IntToBytes

func IntToBytes(n int) []byte

IntToBytes 整形转换成字节

func IsPortInUse

func IsPortInUse(port int) bool

func LocalIP

func LocalIP() string

func LogDir

func LogDir() string

func MD5

func MD5(str string) string

func Open

func Open(url string) error

func PauseExit

func PauseExit()

func PauseGo

func PauseGo(msg ...interface{})

func ReloadConf

func ReloadConf() *ini.File

func SaveToConf

func SaveToConf(section string, kvmap map[string]string) error

func ShortID

func ShortID() string

func UpTime

func UpTime() time.Duration

func UpTimeString

func UpTimeString() string

func WorkInDir

func WorkInDir(f func(), dir string)

Types

type DateTime

type DateTime time.Time

func (DateTime) MarshalJSON

func (dt DateTime) MarshalJSON() ([]byte, error)

func (*DateTime) Scan

func (dt *DateTime) Scan(v interface{}) error

func (DateTime) String

func (dt DateTime) String() string

func (*DateTime) UnmarshalJSON

func (dt *DateTime) UnmarshalJSON(data []byte) (err error)

func (DateTime) Value

func (dt DateTime) Value() (driver.Value, error)

type StringArray

type StringArray string

func (StringArray) MarshalJSON

func (r StringArray) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL