func (c *Client) ResetCompleted() error {
	return c.resetJobs("completed")
}
ResetCompleted asks the daemon to reset completed jobs
package v1
import (
	"encoding/json"
	"fmt"
	"github.com/getsolus/ferryd/jobs"
	"github.com/valyala/fasthttp"
	"io"
	"net/http"
	"strconv"
)
func (c *Client) GetJob(id int) (j *jobs.Job, err error) {
	resp, err := c.client.Get(formURI(fmt.Sprintf("api/v1/jobs/%d", id)))
	if err != nil {
		return
	}
	defer resp.Body.Close()
	if resp.StatusCode != http.StatusOK {
		err = readError(resp.Body)
		return
	}
	dec := json.NewDecoder(resp.Body)
	j = &jobs.Job{}
	if err = dec.Decode(j); err == io.EOF {
		err = nil
	}
	return
}
func (l *Listener) GetJob(ctx *fasthttp.RequestCtx) {
	idString := ctx.UserValue("id").(string)
	id, err := strconv.Atoi(idString)
	if err != nil {
		writeError(ctx, err, http.StatusBadRequest)
		return
	}
	job, err := l.store.GetJob(id)
	if err != nil {
		writeError(ctx, err, http.StatusNotFound)
		return
	}
	enc := json.NewEncoder(ctx)
	if err = enc.Encode(job); err != nil {
		writeError(ctx, err, http.StatusInternalServerError)
	}
}
func (c *Client) resetJobs(status string) error {
	req, err := http.NewRequest("DELETE", formURI("api/v1/jobs"), nil)
	if err != nil {
		return err
	}
	q := req.URL.Query()
	q.Add("status", status)
	req.URL.RawQuery = q.Encode()
	resp, err := c.client.Do(req)
	if err != nil {
		return err
	}
	defer resp.Body.Close()
	if resp.StatusCode != http.StatusOK {
		return readError(resp.Body)
	}
	return nil
}
func (c *Client) ResetFailed() error {
	return c.resetJobs("failed")
}