Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #188 from dshearer/docker-support
Docker support
- Loading branch information
Showing
74 changed files
with
3,472 additions
and
2,512 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
package ipc | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/dshearer/jobber/jobfile" | ||
) | ||
|
||
type ICmd interface{} | ||
|
||
type ICmdResp interface { | ||
Error() error | ||
} | ||
|
||
type errorCmdResp struct { | ||
err error | ||
} | ||
|
||
func (self errorCmdResp) Error() error { | ||
return self.err | ||
} | ||
|
||
func NewErrorCmdResp(err error) ICmdResp { | ||
return errorCmdResp{err: err} | ||
} | ||
|
||
type nonErrorCmdResp struct{} | ||
|
||
func (self nonErrorCmdResp) Error() error { | ||
return nil | ||
} | ||
|
||
type ReloadCmd struct{} | ||
|
||
type ReloadCmdResp struct { | ||
NumJobs int `json:"numJobs"` | ||
nonErrorCmdResp | ||
} | ||
|
||
type JobDesc struct { | ||
Name string `json:"name"` | ||
Status string `json:"status"` | ||
Schedule string `json:"schedule"` | ||
NextRunTime *time.Time `json:"nextRunTime"` | ||
NotifyOnSuccess string `json:"notifyOnSuccess"` | ||
NotifyOnErr string `json:"notifyOnError"` | ||
NotifyOnFail string `json:"notifyOnFailure"` | ||
ErrHandler string `json:"errHandler"` | ||
StdoutDir *string `json:"stdoutDir"` | ||
StderrDir *string `json:"stderrDir"` | ||
} | ||
|
||
type ListJobsCmd struct{} | ||
|
||
type ListJobsCmdResp struct { | ||
Jobs []JobDesc `json:"jobs"` | ||
nonErrorCmdResp | ||
} | ||
|
||
type LogDesc struct { | ||
Time time.Time `json:"time"` | ||
Job string `json:"job"` | ||
Succeeded bool `json:"succeeded"` | ||
Result string `json:"result"` | ||
} | ||
|
||
type LogCmd struct{} | ||
|
||
type LogCmdResp struct { | ||
Logs []LogDesc `json:"logs"` | ||
nonErrorCmdResp | ||
} | ||
|
||
type TestCmd struct { | ||
Job string `json:"job"` | ||
} | ||
|
||
type TestCmdResp struct { | ||
Result string `json:"result"` | ||
nonErrorCmdResp | ||
} | ||
|
||
type CatCmd struct { | ||
Job string `json:"job"` | ||
} | ||
|
||
type CatCmdResp struct { | ||
Result string `json:"result"` | ||
nonErrorCmdResp | ||
} | ||
|
||
type PauseCmd struct { | ||
Jobs []string `json:"jobs"` | ||
} | ||
|
||
type PauseCmdResp struct { | ||
NumPaused int `json:"numPaused"` | ||
nonErrorCmdResp | ||
} | ||
|
||
type ResumeCmd struct { | ||
Jobs []string `json:"jobs"` | ||
} | ||
|
||
type ResumeCmdResp struct { | ||
NumResumed int `json:"numResumed"` | ||
nonErrorCmdResp | ||
} | ||
|
||
type InitCmd struct{} | ||
|
||
type InitCmdResp struct { | ||
JobfilePath string `json:"jobfilePath"` | ||
nonErrorCmdResp | ||
} | ||
|
||
type JobV3RawWithName struct { | ||
jobfile.JobV3Raw | ||
Name string | ||
} | ||
|
||
type SetJobCmd struct { | ||
Job JobV3RawWithName `json:"job"` | ||
} | ||
|
||
type SetJobCmdResp struct { | ||
Ok bool `json:"ok"` // just to make IPC work | ||
nonErrorCmdResp | ||
} | ||
|
||
type DeleteJobCmd struct { | ||
Job string `json:"job"` | ||
} | ||
|
||
type DeleteJobCmdResp struct { | ||
Ok bool `json:"ok"` // just to make IPC work | ||
nonErrorCmdResp | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
IPC_SOURCES := \ | ||
ipc/commands.go \ | ||
ipc/sources.mk | ||
|
||
IPC_TEST_SOURCES := |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.