Documentation
¶
Index ¶
- type Action
- type Message
- type Sync
- func NewDiskSync(src, target core.VFS, enableLogicallyDelete bool) (s Sync, err error)
- func NewRemoteClientSync(src, target core.VFS, users []*auth.User, enableLogicallyDelete bool) (Sync, error)
- func NewRemoteServerSync(src, target core.VFS, enableTLS bool, certFile string, keyFile string, ...) (Sync, error)
- func NewRemoteSync(src, target core.VFS, enableTLS bool, certFile string, keyFile string, ...) (Sync, error)
- func NewSync(src core.VFS, target core.VFS, enableTLS bool, certFile string, keyFile string, ...) (Sync, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action int
const ( UnknownAction Action = iota // CreateAction the action of create a file CreateAction // WriteAction the action of write data to the file WriteAction // RemoveAction the action of remove the file RemoveAction // RenameAction the action of rename the file RenameAction // ChmodAction the action of change the file mode ChmodAction )
type Message ¶
type Message struct {
contract.Status
contract.FileInfo
// Action the action of file change
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 target once
SyncOnce(path string) error
// Source the source file system
Source() core.VFS
// Target the target file system
Target() core.VFS
}
Sync a file sync interface
func NewDiskSync ¶
NewDiskSync create a diskSync instance src is source path to read target is target path to write
func NewRemoteClientSync ¶
func NewRemoteClientSync(src, target core.VFS, users []*auth.User, enableLogicallyDelete bool) (Sync, error)
NewRemoteClientSync create an instance of remoteClientSync to receive the file change message and execute it
func NewRemoteServerSync ¶
func NewRemoteServerSync(src, target core.VFS, enableTLS bool, certFile string, keyFile string, users []*auth.User, enableLogicallyDelete bool) (Sync, error)
NewRemoteServerSync create an instance of remoteServerSync execute send file change message
Click to show internal directories.
Click to hide internal directories.