Documentation ¶
Index ¶
- func BytesToHumanReadable(b uint64) string
- func BytesToUint16(b []byte) (v uint16)
- func BytesToUint32(b []byte) (v uint32)
- func BytesToUint64(b []byte) (v uint64)
- func CheckFile(filename string) (exists, canRead, canWrite bool, modTime time.Time, fileSize int64)
- func CheckFileExists(filename string) bool
- func FormatTime2String(s string) string
- func GetBetweenDates(startdate, enddate string) []string
- func GetBigFileLists(path string, arcfiles map[string]string, key string) error
- func GetDaysDiffer(from, to string) ([]string, int, error)
- func GetFileList(path string, arcfiles map[string][]string, key string)
- func GetFileListName(path string, arcfiles map[string]string, key string) error
- func GetFileListNamebyCreateTime(path string, key string) (string, error)
- func GetFileSize(file *os.File) (size int64, err error)
- func GetFileUIDGid(fi os.FileInfo) (uid, gid uint32)
- func GetHourDiffer(starttime, endtime string) (map[string][]string, int, error)
- func GetLastCreateFile(path string) string
- func GetTDEngineHostName() (string, string)
- func GetTimeRangeFromFileName(filename string) (start, end time.Time, sensorid string, err error)
- func GzipData(input []byte, logger logging.ILogger) ([]byte, error)
- func GzipFile(subdirectory, filepath, filename string, header, data []byte) error
- func HashStringToLong(dir string) (v int64, err error)
- func HashToInt32(data []byte) (v int32, err error)
- func IsContainItem(items []string, item string) bool
- func IsDigit(str string) bool
- func IsGzippable(ext, mtype string, data []byte) bool
- func IsGzippableFileType(ext, mtype string) (shouldBeZipped, iAmSure bool)
- func IsZeroTime(timestamp, timestamp2 time.Time, duration string, num int) bool
- func Join(names ...string) string
- func Md5(data []byte) (string, error)
- func PathExists(path string) (bool, error)
- func RemoveFolders(dir string) error
- func SeekBigFileHeader(filename string, start, size int64) ([]byte, error)
- func TestFolderWritable(folder string, logger logging.ILogger) (err error)
- func TimeStringReplace(timer time.Time) string
- func Uint16toBytes(b []byte, v uint16)
- func Uint32toBytes(b []byte, v uint32)
- func Uint64toBytes(b []byte, v uint64)
- func Uint8toBytes(b []byte, v uint8)
- func UnGzipData(input []byte, logger logging.ILogger) ([]byte, error)
- func UnGzipFile(filepath, filename string) error
- type FullPath
- type MultiLocker
- type Queue
- type WriteThrottler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToHumanReadable ¶
BytesToHumanReadable returns the converted human readable representation of the bytes.
func CheckFileExists ¶
CheckFileExists check file is exist
func GetBigFileLists ¶
GetBigFileLists -
func GetFileList ¶
GetFileList -
func GetFileListName ¶
GetFileListName -
func GetFileListNamebyCreateTime ¶
GetFileListNamebyCreateTime -
func GetFileSize ¶
GetFileSize get file size
func GetFileUIDGid ¶
GetFileUIDGid return fileinfo
func GetHourDiffer ¶
GetHourDiffer -
func GetLastCreateFile ¶
GetLastCreateFile - get last create file name
func GetTDEngineHostName ¶
GetTDEngineHostName Get TDEngien docker host name
func GetTimeRangeFromFileName ¶
GetTimeRangeFromFileName -
func HashStringToLong ¶
HashStringToLong returns a 64 bit big int
func HashToInt32 ¶
HashToInt32 convert bytes to int32
func IsGzippableFileType ¶
IsGzippableFileType return shouldbezipped & iamsure
* Default more not to gzip since gzip can be done on client side.
func IsZeroTime ¶
IsZeroTime 时间格式化: 零点,整小时,整分
func SeekBigFileHeader ¶
SeekBigFileHeader -
func TestFolderWritable ¶
TestFolderWritable stat of folder
func UnGzipData ¶
UnGzipData return byte
Types ¶
type FullPath ¶
type FullPath string
FullPath string
func (FullPath) DirAndName ¶
DirAndName return dir and name
type MultiLocker ¶
MultiLocker -
type WriteThrottler ¶
type WriteThrottler struct {
// contains filtered or unexported fields
}
WriteThrottler struct
func NewWriteThrottler ¶
func NewWriteThrottler(bytesPerSecond int64) *WriteThrottler
NewWriteThrottler return *WriteThrottler
func (*WriteThrottler) MaybeSlowdown ¶
func (wt *WriteThrottler) MaybeSlowdown(delta int64)
MaybeSlowdown -