Documentation ¶
Index ¶
- Constants
- Variables
- func AddBatchSyncError(absPath string, reason string, sn string)
- func CancelTask(busType int)
- func CompareAndCacheMd5(sf *os.File, tf *os.File) bool
- func CompareMd5(sf *os.File, tf *os.File) bool
- func CompareModifyTime(sf *os.File, tf *os.File) bool
- func CreateFile(bufferSize CapacityUnit, filePath string, fileSize CapacityUnit, ...) (success bool, usedTime float64)
- func CreateTimePoint(name string, sourcePath string, targetPath string, marks string, needLog bool)
- func EstimatedTotalTime(sn string, timeCell time.Duration) time.Duration
- func FloatRound(f float64, n int) float64
- func GetFileMd5(f *os.File) *string
- func GetFileName(path string) string
- func GetFileTree(startPath string, layer int)
- func GetLocalBatchProgress(sn string) float64
- func GetNextSyncTime(dayArray [7]bool, min uint8, hour uint8) time.Duration
- func GetPartitionsInfo()
- func GetRemoteDiskInfo(ip string) *[]Partition
- func GetSuitableCapacityStr(c uint64) string
- func GetTimeSum(daySub int, hourSub int, minSub int) time.Duration
- func GetTotalSize(sn *string, startPath string, isRoot bool, lock *sync.WaitGroup)
- func LoadWorkerFactory()
- func LocalBatchSyncSingleTime(isPolicy bool)
- func LocalSingleSyncSingleTime(isPolicy bool)
- func NewLocalSingleWorker(sourceFile *os.File, targetFile *os.File, sn string, md5CacheFlag bool) *common.QWorker
- func NewQNQAuthReceiver(SN string) *common.QWorker
- func NewRemoteSyncReceiver(SN string) *common.QWorker
- func PartitionSyncSingleTime()
- func RemoteSingleSyncSingleTime(localPath string, remotePath string, ip string)
- func ReverseCompareAndDelete(sourcePath string, targetPath string)
- func StartPolicySync(duration time.Duration, notEnd *bool, isBatch bool, isRemote bool, ...)
- func TestDiskSpeed(bufferSize CapacityUnit, totalSize CapacityUnit, drive string) (writeSpeed int, readSpeed int)
- type CapacityUnit
- type Disk
- type Partition
- type SyncFileError
Constants ¶
View Source
const ( Byte CapacityUnit = 1 KB = 1024 * Byte MB = 1024 * KB GB = 1024 * MB TB = 1024 * GB PB = 1024 * TB )
View Source
const ( GET_FILE_ROOT_URI = "/fileRootMap" GET_DISK_INFO_URI = "/disk/info" TEST_CONNECT = "/debug/connect" )
View Source
const ( COMPARE_RUNNING = "[Comparing] " SYNC_RUNNING = "[Syncing] " VERIFY_MD5 = "[Verify MD5] " )
View Source
const (
URL_HRED = "http://"
)
Variables ¶
View Source
var CapacityStrMap = make(map[string]CapacityUnit)
View Source
var DiskPartitionsCache []Partition
View Source
var DiskReadSpeedCache = make(map[string]float64)
View Source
var DiskWriteSpeedCache = make(map[string]float64)
Functions ¶
func AddBatchSyncError ¶
func CreateFile ¶
func CreateFile(bufferSize CapacityUnit, filePath string, fileSize CapacityUnit, randomContent bool) (success bool, usedTime float64)
CreateFile fileSize : KB
func CreateTimePoint ¶
CreateTimePoint worker对外暴露的创建时间点方法
func EstimatedTotalTime ¶
EstimatedTotalTime 估计完成所需的时间
func FloatRound ¶
func GetFileMd5 ¶
func GetFileName ¶
func GetLocalBatchProgress ¶
func GetPartitionsInfo ¶
func GetPartitionsInfo()
func GetRemoteDiskInfo ¶
func GetSuitableCapacityStr ¶
func GetTotalSize ¶
func LoadWorkerFactory ¶
func LoadWorkerFactory()
func LocalBatchSyncSingleTime ¶
func LocalBatchSyncSingleTime(isPolicy bool)
LocalBatchSyncSingleTime 直接读取配置文件,无需参数
func LocalSingleSyncSingleTime ¶
func LocalSingleSyncSingleTime(isPolicy bool)
LocalSingleSyncSingleTime 直接读取配置文件,无需参数
func NewLocalSingleWorker ¶
func NewQNQAuthReceiver ¶
func NewRemoteSyncReceiver ¶
func PartitionSyncSingleTime ¶
func PartitionSyncSingleTime()
func ReverseCompareAndDelete ¶
func StartPolicySync ¶
func TestDiskSpeed ¶
func TestDiskSpeed(bufferSize CapacityUnit, totalSize CapacityUnit, drive string) (writeSpeed int, readSpeed int)
Types ¶
type CapacityUnit ¶
type CapacityUnit uint64
func ConvertCapacity ¶
func ConvertCapacity(str string) CapacityUnit
type SyncFileError ¶
func GetBatchSyncError ¶
func GetBatchSyncError(sn string) []SyncFileError
Click to show internal directories.
Click to hide internal directories.