Documentation ¶
Index ¶
- Constants
- Variables
- func CaptureOutput(f func()) string
- func CreateDefault(path string) error
- func GetFileName(path string) string
- func PrintLog(text ...interface{})
- func ShowConf(conf *Conf)
- func WarningSound()
- func Watch(conf Conf, handleFunc HandleFunc)
- type Conf
- type DeployOnceEI
- type Event
- type EventCtrl
- type EventType
- type Filter
- type HandleFunc
- type LogFormat
Constants ¶
View Source
const ( // DefaultSpec ... DefaultSpec = "master" // DefaultConfName ... DefaultConfName = "caravan.yml" )
Variables ¶
View Source
var DefaultConf = Conf{ Source: ".", Destination: ".", Mode: deploy.ModeRSync, Incremental: true, Once: false, Debug: false, Exclude: []string{".git", ".svn", "/node_modules"}, ExtraArgs: []string{}, LogFormat: "[%t] EVENT %e: %p", OnInit: []string{}, OnChange: []string{}, OnDeploy: []string{}, OnError: []string{}, }
DefaultConf of Caravan
View Source
var ErrNoCommand = errors.New("No command attached")
ErrNoCommand ...
PrintError print red text
View Source
var PrintNotice = fmt.Println
PrintNotice print normal text
View Source
var PrintSuccess = color.New(color.FgGreen).PrintlnFunc()
PrintSuccess print green text
PrintWarning print yellow text
Functions ¶
Types ¶
type Conf ¶
type Conf struct { Source string `yaml:"src"` Destination string `yaml:"dst"` Mode deploy.Mode `yaml:"deploy_mode"` Once bool `yaml:"once"` Debug bool `yaml:"debug"` Incremental bool `yaml:"incremental"` Exclude []string `yaml:"exclude"` ExtraArgs []string `yaml:"extra_args"` LogFormat string `yaml:"log_format"` OnInit []string `yaml:"on_init"` OnChange []string `yaml:"on_change"` OnDeploy []string `yaml:"on_deploy"` OnError []string `yaml:"on_error"` }
Conf of van
type DeployOnceEI ¶
type DeployOnceEI struct {
SourcePath string
}
DeployOnceEI implements notify.EventInfo interface which is passed to events of DeployOnce
type Event ¶
Event body
func NewEmptyEvent ¶
NewEmptyEvent creates an empty event with only event type
type EventCtrl ¶
type EventCtrl struct {
// contains filtered or unexported fields
}
EventCtrl for event scheduling
Source Files ¶
Click to show internal directories.
Click to hide internal directories.