Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleDebug ¶
Turn on debug logging if -debug was specified
Types ¶
type Config ¶
type Config struct {
ApiVersion string
Executable
Profiles []Profile
Apps []App
}
func ReadConfig ¶
type Executable ¶
type FSEventMonitor ¶
type FSEventMonitor struct {
// contains filtered or unexported fields
}
func NewFSEventMonitor ¶
func NewFSEventMonitor(path string) FSEventMonitor
func (*FSEventMonitor) Start ¶
func (fsm *FSEventMonitor) Start(debounceTime uint64)
func (*FSEventMonitor) Stop ¶
func (fsm *FSEventMonitor) Stop()
func (*FSEventMonitor) Subscribe ¶
func (fsm *FSEventMonitor) Subscribe(subscriber chan<- []string)
type Monitor ¶
type Monitor interface {
// Start watching for file system changes. Specify the debounceTime so the events are collected within the debounce time.
Start(debounceTime uint64)
// Register a observer to receive the fs events
Subscribe(observer chan<- []string)
// Stop file system watching.
Stop()
}
func NewMonitor ¶
type Profile ¶
type Profile struct {
// profile name
Name string
// The connection information used by sync module
Connection SyncConnection
// The name of ignore file, default to .piaasignore
IgnoreFile string
}
Profile controls how the project can sync to remote machine.
type RsyncPattern ¶
type RsyncPattern struct {
// contains filtered or unexported fields
}
Implement basic rsync filter rules.
Support the below notation ¶
- Exact, path element without special character. Ex: foo - Anchored, path start with `/`. Ex: /foo - Wildcard, path element that matches any character. Ex: foo* - Double wildcards, path elements that matches any character including sub directories. Ex: foo/** - Multi segments, path elements that span over one level in the hierarchy. Ex: foo/bar
func (RsyncPattern) Match ¶
func (rp RsyncPattern) Match(path string) bool
Match a given path to make sure it matches this pattern or not. You should not directly
func (RsyncPattern) ToString ¶
func (rp RsyncPattern) ToString() string
type RsyncPatterns ¶
type RsyncPatterns struct {
// contains filtered or unexported fields
}
func NewRsyncPatterns ¶
func NewRsyncPatterns(basedir string, patterns ...RsyncPattern) RsyncPatterns
Create a new RsyncPatterns.
func (*RsyncPatterns) Match ¶
func (rp *RsyncPatterns) Match(path string) bool
Working on a path under the basedir to see if it matches with any of the registered patterns. False is returned if path wasn't under basedir.
type RsyncWrapper ¶
type RsyncWrapper struct {
// The rsync command to execute, usually just 'rsync' on Mac and Linux.
// But may involves batch file on windows.
Executable
// contains filtered or unexported fields
}
func NewRsyncWrapper ¶
func NewRsyncWrapper(rsyncCmd Executable, basedir string, target string) RsyncWrapper
Create a RsyncWrapper using `cmd` as the command, running on `basedir`, syncing to `target`. The RsyncWrapper will also be configured to use ssh options 'ConnectTimeout=10'
func (*RsyncWrapper) SetIgnoreFile ¶
func (rs *RsyncWrapper) SetIgnoreFile(ignore string)
func (*RsyncWrapper) SetSshOptions ¶
func (rs *RsyncWrapper) SetSshOptions(options string)
func (*RsyncWrapper) Start ¶
func (rs *RsyncWrapper) Start(process func(cmd *exec.Cmd))
Open the channel to start working on sync events
When cmd is received, `process` will be invoked to actually running the command.
func (*RsyncWrapper) SyncFiles ¶
func (rs *RsyncWrapper) SyncFiles(files []string)
Sync only the specified files If the files list is empty, do nothing
type SyncConnection ¶
The sync connection target