func GetBindings(endpoint string, query string) ([]map[string]Binding, time.Duration) {
    body, et := executeQuery(endpoint, query)
    defer body.Close()
    dec := json.NewDecoder(body)
    var res = new(struct{Results struct{Bindings []map[string]Binding}})
    if err := dec.Decode(&res); err != nil {
        _, file, line, ok := runtime.Caller(2)
        if ok {
            glog.Infof("Caller: file=%v line=%v", file, line)
        }
        glog.Fatal(err)
    }
    return res.Results.Bindings, et
}
GetBindings returns the list of Bindings for the query over the endpoint.
package eval
import (
    "runtime"
    "net/http"
    "net/url"
    "github.com/golang/glog"
    "encoding/json"
    "io"
    "time"
)
type Binding map[string]string
func executeQuery(endpoint string, query string) (io.ReadCloser, time.Duration) {
    time.Sleep(time.Second)
    q := endpoint + "?format=application/json&query=" + url.QueryEscape(query)
    glog.Infof("Execute request: [%s]", q)
    start := time.Now()
    resp, err := http.Get(q)
    if err != nil {
        glog.Fatal(err)
    }
    return resp.Body, time.Since(start)
}