func ContextWithJob(parent context.Context, job *BuildJob) context.Context {
	return context.WithValue(parent, &ctxKey, job)
}
ContextWithJob set parent context BuildJob and returns it.
package application
import (
	"context"
	"fmt"
	"github.com/duck8823/duci/domain/model/job"
	"github.com/duck8823/duci/domain/model/job/target/github"
	"net/url"
	"time"
)
var ctxKey = "duci_job"
type BuildJob struct {
	ID           job.ID
	TargetSource *github.TargetSource
	TaskName     string
	TargetURL    *url.URL
	beginTime    time.Time
	endTime      time.Time
}
func (j *BuildJob) BeginAt(time time.Time) {
	j.beginTime = time
}
func (j *BuildJob) EndAt(time time.Time) {
	j.endTime = time
}
func (j *BuildJob) Duration() string {
	dur := j.endTime.Sub(j.beginTime)
	if int(dur.Minutes()) > 0 {
		return fmt.Sprintf("%dmin", int(dur.Minutes()))
	}
	return fmt.Sprintf("%dsec", int(dur.Seconds()))
}