func (c *Client) runJob(req *http.Request) (j *jobs.Job, err error) {
	resp, err := c.client.Do(req)
	if err != nil {
		return
	}
	defer resp.Body.Close()
	if resp.StatusCode != http.StatusOK {
		err = readError(resp.Body)
		return
	}
	id, err := readID(resp)
	if err != nil {
		return
	}
	start := time.Now()
	for {
		time.Sleep(time.Second)
		if j, err = c.GetJob(id); err != nil {
			return
		}
		if j.Status > jobs.Running {
			return
		}
		fmt.Printf("Elapsed Time: %s\n", time.Now().Sub(start).String())
	}
}
runJob creates a job and then retries periodically to read back a job.
package v1
import (
	"context"
	"fmt"
	"github.com/getsolus/ferryd/jobs"
	"github.com/getsolus/ferryd/repo"
	"net"
	"net/http"
	"time"
)
const Version = "1.0.0"
type Client struct {
	client *http.Client
}
func NewClient(address string) *Client {
	return &Client{
		client: &http.Client{
			Transport: &http.Transport{
				DialContext: func(ctx context.Context, network, addr string) (net.Conn, error) {
					return net.Dial("unix", address)
				},
				DisableKeepAlives:     false,
				IdleConnTimeout:       30 * time.Second,
				ExpectContinueTimeout: 1 * time.Second,
			},
			Timeout: 60 * time.Second,
		},
	}
}
func (c *Client) Close() {
	c.client.Transport.(*http.Transport).CloseIdleConnections()
}