Documentation ¶
Index ¶
- func BytesIndexOf(b, sub []byte) int
- func CombineBytes(one []byte, others ...[]byte) []byte
- func GetTodayInterval() (begin, end time.Time)
- func HumanReadableByteCount(bytes int64, si bool) string
- func JsonToString(v interface{}) string
- func ListenFileChanged(filepath string, v interface{}, ...) bool
- func ListenJsonFile(v interface{}, notifyFunc func(filepath string, v interface{}) error, ...) bool
- func ListenTextFile(notifyFunc func(filepath, content string) error, filepaths ...string) bool
- func LoadJsonFile(v interface{}, notifyFunc func(filepath string, v interface{}) error, ...) bool
- func LoadTextFile(notifyFunc func(filepath, content string) error, filepaths ...string) bool
- func NewQueue() *unsafeQueue
- func NewSafeQueue() *safeQueue
- func NewUuid() string
- func NowDate() time.Time
- func RandIntn(n int) int
- func RemoveFileChangedListener(filepath string)
- func SmartSleep(d time.Duration, max time.Duration) time.Duration
- func TimeNow() *time.Time
- func ToPerSecond(total int64, duration time.Duration) int64
- type Map
- type Queue
- type Set
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesIndexOf ¶
func CombineBytes ¶
func GetTodayInterval ¶
func HumanReadableByteCount ¶
func JsonToString ¶
func JsonToString(v interface{}) string
func ListenFileChanged ¶
func ListenJsonFile ¶
func ListenTextFile ¶
func LoadJsonFile ¶
func LoadTextFile ¶
func NewSafeQueue ¶
func NewSafeQueue() *safeQueue
func RemoveFileChangedListener ¶
func RemoveFileChangedListener(filepath string)
Types ¶
type Map ¶
type Map interface { Put(key interface{}, value interface{}) Get(key interface{}, defaultValue ...interface{}) (value interface{}) Remove(key interface{}) Pick(key interface{}, defaultValue ...interface{}) (value interface{}) Has(key interface{}) bool Range(f func(key interface{}, value interface{})) Size() int IsEmpty() bool Clear() }
func NewSafeMap ¶
func NewSafeMap() Map
Click to show internal directories.
Click to hide internal directories.