Go library
For documentation on older releases of Watchman (v0.31.x series), please visit the older docs website in our GitHub repository.
import (
"github.com/moov-io/watchman/pkg/search"
)
func main() {
client := search.NewClient(nil, "http://localhost:8084")
ctx := context.Background()
query := public.Entity[public.Value]{
Name: "Flight",
Type: public.EntityAircraft,
}
var opts public.SearchOpts
response, err := scope.client.SearchByEntity(ctx, query, opts)
if err != nil {
// deal with errors
}
for _, entity := response.Entities {
// do something with each entity
}
}