🍽 A Go client library for the UK Food Hygiene Rating Scheme API.
Simply go get
or add it to your imports and run any go
command to auto-update your modules.
go get -u github.com/dcrichards/go-fhrs
package main
import (
"github.com/dcrichards/go-fhrs/fhrs"
)
func main() {
client, err := fhrs.NewClient()
if err != nil {
// Handle err
}
est, err := client.Establishments.GetByID("82940")
if err != nil {
// Handle err
}
// Do stuff with est
}
An example can be found in the example
directory.
Tests use a mock server and do not require access to the API.
Docker
docker-compose run --rm go test ./...
# With coverage
docker-compose run --rm go test -coverprofile=coverage.out ./...
No Docker
CGO_ENABLED=0 go test ./...
# With coverage
CGO_ENABLED=0 go test -coverprofile=coverage.out ./...