Documentation
¶
Index ¶
- Variables
- func AppendBytes(fpath string, bs []byte) error
- func EncodePassword(password, salt string) string
- func FormatTime(t time.Time) string
- func InitRandSeed()
- func MD5(s string) string
- func Must(i interface{}, e error) interface{}
- func NewDataSourceName(user, password, host, port, dbName string) string
- func Now() time.Time
- func RandString(n int) string
- func ReadFile(fpath string) ([]byte, error)
- func ReadJson(fpath string, i interface{}) error
- func ReadToml(fpath string, i interface{}) error
- func Recover()
- func Wait(timeout, step time.Duration, f func() bool) bool
- func WriteBytes(fpath string, data []byte) error
- func WriteJson(fpath string, i interface{}) error
- type BufferPool
- type TimeUtil
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefTimeUtil = NewTimeUtil()
)
Functions ¶
func AppendBytes ¶ added in v0.0.2
func EncodePassword ¶ added in v0.1.6
func FormatTime ¶ added in v0.1.3
func InitRandSeed ¶ added in v0.1.7
func InitRandSeed()
func NewDataSourceName ¶ added in v0.0.2
func RandString ¶ added in v0.1.5
func WriteBytes ¶ added in v0.0.2
Types ¶
type BufferPool ¶ added in v0.1.2
type BufferPool struct {
// contains filtered or unexported fields
}
func NewBufferPool ¶ added in v0.1.2
func NewBufferPool() *BufferPool
func (*BufferPool) Get ¶ added in v0.1.2
func (b *BufferPool) Get() *hbuffer.Buffer
func (*BufferPool) Put ¶ added in v0.1.2
func (b *BufferPool) Put(buf *hbuffer.Buffer)
type TimeUtil ¶ added in v0.1.3
type TimeUtil struct {
// contains filtered or unexported fields
}
时间工具,在测试中,很多时候需要控制 time.Now() 产生的时间 例如:设置当前时间为 3天 后,用正常时间的 1/10 行进时间
func NewTimeUtil ¶ added in v0.1.3
func NewTimeUtil() *TimeUtil
Click to show internal directories.
Click to hide internal directories.