Seamless Integration with Go Library
For documentation on older releases of Watchman (v0.31.x series), please visit the older docs website in our GitHub repository.
Embed Watchman’s powerful screening capabilities directly into your Go applications for efficient, programmatic compliance checks.
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
}
}