Exemple #1
0
//GetJobs just make the http request
func GetJobs(server string) ([]*format.Job, error) {
	req := &format.Request{List: &format.ListRequest{}}

	c := format.NewClient(server)
	resp, err := c.Proto(req)
	if err != nil {
		return nil, err
	}
	return resp.GetList().GetJobs(), nil
}
Exemple #2
0
//GetRemoteExecution makes the query on the ci server to get refresh and build information.
// It transforms them into RemoteExecution
func GetRemoteExecution(remoteurl string, req *format.Request) (b, r *RemoteExecution) {
	c := format.NewClient(remoteurl)
	resp, err := c.Proto(req)
	if err != nil {
		log.Fatal(err.Error())
	}
	job := resp.GetLog().GetJob()
	// now present the resp
	//
	r = NewRemoteExecution(job.GetRefresh(), "refresh")
	b = NewRemoteExecution(job.GetBuild(), "build")
	return
}
Exemple #3
0
func NewClient(server string) Client {
	return Client{format.NewClient(server)}
}