mirror of
https://github.com/zrepl/zrepl.git
synced 2025-08-09 15:14:52 +02:00
@ -28,10 +28,36 @@ func init() {
|
||||
|
||||
type Job interface {
|
||||
JobName() string
|
||||
JobType() JobType
|
||||
JobStart(ctxt context.Context)
|
||||
JobStatus(ctxt context.Context) (*JobStatus, error)
|
||||
}
|
||||
|
||||
type JobType string
|
||||
|
||||
const (
|
||||
JobTypePull JobType = "pull"
|
||||
JobTypeSource JobType = "source"
|
||||
JobTypeLocal JobType = "local"
|
||||
JobTypeControl JobType = "control"
|
||||
)
|
||||
|
||||
func ParseUserJobType(s string) (JobType, error) {
|
||||
switch s {
|
||||
case "pull":
|
||||
return JobTypePull, nil
|
||||
case "source":
|
||||
return JobTypeSource, nil
|
||||
case "local":
|
||||
return JobTypeLocal, nil
|
||||
}
|
||||
return "", fmt.Errorf("unknown job type '%s'", s)
|
||||
}
|
||||
|
||||
func (j JobType) String() string {
|
||||
return string(j)
|
||||
}
|
||||
|
||||
func doDaemon(cmd *cobra.Command, args []string) {
|
||||
|
||||
conf, err := ParseConfig(rootArgs.configFile)
|
||||
|
Reference in New Issue
Block a user