Documentation
¶
Index ¶
- type Message
- type Sync
- func NewDiskSync(source, dest core.VFS, enableLogicallyDelete bool, chunkSize int64, ...) (s Sync, err error)
- func NewPushClientSync(source, dest core.VFS, enableTLS bool, users []*auth.User, ...) (Sync, error)
- func NewRemoteClientSync(source, dest core.VFS, users []*auth.User, enableLogicallyDelete bool, ...) (Sync, error)
- func NewRemoteServerSync(source, dest core.VFS, enableTLS bool, certFile string, keyFile string, ...) (Sync, error)
- func NewRemoteSync(source, dest core.VFS, enableTLS bool, certFile string, keyFile string, ...) (Sync, error)
- func NewSync(source core.VFS, dest core.VFS, enableTLS bool, certFile string, ...) (Sync, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct {
contract.Status
contract.FileInfo
// Action the action of file change
Action action.Action `json:"action"`
// BaseUrl the base url of file server
BaseUrl string `json:"base_url"`
}
Message a message of the remote file change
type Sync ¶
type Sync interface {
// Create create the path
Create(path string) error
// Write write the data to path
Write(path string) error
// Remove remove the path
Remove(path string) error
// Rename rename the path
Rename(path string) error
// Chmod change the mode of path
Chmod(path string) error
// IsDir is a dir the path
IsDir(path string) (bool, error)
// SyncOnce sync the path to dest once
SyncOnce(path string) error
// Source the source file system
Source() core.VFS
// Dest the destination file system
Dest() core.VFS
}
Sync a file sync interface
func NewDiskSync ¶
func NewDiskSync(source, dest core.VFS, enableLogicallyDelete bool, chunkSize int64, checkpointCount int) (s Sync, err error)
NewDiskSync create a diskSync instance source is source path to read dest is dest path to write
func NewPushClientSync ¶ added in v0.3.0
func NewPushClientSync(source, dest core.VFS, enableTLS bool, users []*auth.User, enableLogicallyDelete bool, chunkSize int64, checkpointCount int) (Sync, error)
NewPushClientSync create an instance of the pushClientSync
func NewRemoteClientSync ¶
func NewRemoteClientSync(source, dest core.VFS, users []*auth.User, enableLogicallyDelete bool, chunkSize int64) (Sync, error)
NewRemoteClientSync create an instance of remoteClientSync to receive the file change message and execute it
func NewRemoteServerSync ¶
func NewRemoteServerSync(source, dest core.VFS, enableTLS bool, certFile string, keyFile string, users []*auth.User, enableLogicallyDelete bool, chunkSize int64, checkpointCount int) (Sync, error)
NewRemoteServerSync create an instance of remoteServerSync execute send file change message
func NewRemoteSync ¶
func NewRemoteSync(source, dest core.VFS, enableTLS bool, certFile string, keyFile string, users []*auth.User, enableLogicallyDelete bool, chunkSize int64, checkpointCount int) (Sync, error)
NewRemoteSync auto create an instance of remoteServerSync or remoteClientSync according to source and dest
Click to show internal directories.
Click to hide internal directories.