go-coveo is a Go client library for accessing the Coveo Search API and the Coveo Usage Analytics API
https://godoc.org/github.com/coveo/go-coveo/analytics
import "github.com/coveo/go-coveo/analytics"
uaConfig := analytics.Config {
Token: "My_Token",
UserAgent: "Some UserAgent",
IP: "Some IP",
Endpoint: "https://my.analytics.endpoint.com"
}
uaClient := analytics.NewClient(uaConfig)
searchEvent := analytics.NewSearchEvent()
searchEvent.SearchQueryUID = "myQueryUID"
if err := uaClient.SendSearchEvent(searchEvent); err != nil {
// Error
}
...
https://godoc.org/github.com/coveo/go-coveo/search
import "github.com/coveo/go-coveo/search"
searchConfig := search.Config {
Token: "My_Token",
UserAgent: "Some UserAgent",
Endpoint: "https://my.endpoint.com"
}
searchClient, err := search.NewClient(searchConfig)
if response, err = searchClient.Query(myQuery); err != nil {
// Error
}
...