Skip to content

🍽 A Go client library for the UK Food Hygiene Rating Scheme API.

License

Notifications You must be signed in to change notification settings

DCRichards/go-fhrs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-fhrs

PkgGoDev

🍽 A Go client library for the UK Food Hygiene Rating Scheme API.

Usage

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
}

Examples

An example can be found in the example directory.

Testing

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 ./...

About

🍽 A Go client library for the UK Food Hygiene Rating Scheme API.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published