WIP PoC signalling

This commit is contained in:
Christian Schwarz
2021-03-21 21:57:26 +01:00
parent 40be626b3a
commit 97a14dba90
9 changed files with 172 additions and 231 deletions
+9 -6
View File
@@ -11,6 +11,7 @@ import (
"github.com/pkg/errors"
"github.com/zrepl/zrepl/daemon"
"github.com/zrepl/zrepl/daemon/job"
)
type Client struct {
@@ -42,14 +43,16 @@ func (c *Client) StatusRaw() ([]byte, error) {
return r, nil
}
func (c *Client) signal(job, sig string) error {
return jsonRequestResponse(c.h, daemon.ControlJobEndpointSignal,
func (c *Client) signal(jobName, sig string) error {
return jsonRequestResponse(c.h, daemon.ControlJobEndpointSignalActive,
struct {
Name string
Op string
Job string
job.ActiveSideSignalRequest
}{
Name: job,
Op: sig,
Job: jobName,
ActiveSideSignalRequest: job.ActiveSideSignalRequest{
What: sig,
},
},
struct{}{},
)