Documentation ¶
Index ¶
Constants ¶
View Source
const ( MsgSync = "SYNC" MsgMd5List = "MD5LIST" MsgTran = "TRAN" MsgTranData = "TRAN-DATA" MsgEnd = "END" MsgError = "ERROR" )
Variables ¶
View Source
var ( // TLSEnabled 是否启用TLS加密 TLSEnabled bool TLSCertFile string TLSKeyFile string )
Functions ¶
func Md5OfAFile ¶
func StartFileSyncServer ¶
func StartFileSyncServer(host, port, authKey string)
StartFileSyncServer 启动文件同步服务监听
func WorkerStartupSync ¶
func WorkerStartupSync(host, port, authKey string)
WorkerStartupSync worker在启动时进行文件同步
Types ¶
type Message ¶
type Message struct { MgAuthKey string MgType string // MgByte []byte // MgString string // MgStrings []string MgFileMode os.FileMode Del bool // whether should the not exist files in src be deleted. Overwrite bool // whether the conflicted files be }
Message 文件同步交互消息
type NotifyFile ¶
type NotifyFile struct { ChNeedWorkerSync chan string // contains filtered or unexported fields }
func NewNotifyFile ¶
func NewNotifyFile() *NotifyFile
func (*NotifyFile) WatchFile ¶
func (n *NotifyFile) WatchFile(srcPathFile []string)
WatchFile 监控指定文件的变化
Click to show internal directories.
Click to hide internal directories.