Example #1
0
File: main.go Project: ericaro/sbr
//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
}
Example #2
0
File: utils.go Project: ericaro/sbr
//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
}
Example #3
0
func NewClient(server string) Client {
	return Client{format.NewClient(server)}
}