go-ilab-childlabor provides programmatic acces to the ILAB Child Labor API.
go get github.com/gmccue/go-ilab-childlabor
In order to use this library, you must have a valid API token for the DOL Public API. You can register for an API key at the US DOL website.
Sample usage:
import laborstats "github.com/gmccue/go-ilab-childlabor"
func test() {
api := lstats.NewLaborStatsAPI("{your API token}")
api.Debug = true
countryData, err := api.QueryCountryData()
if err != nil {
log.Println(err)
}
log.Printf("%v", countryData)
}
Field | Type | Description | Example |
---|---|---|---|
Debug | Bool | Output detailed information related to an API request. Uses pkg log . |
api.Debug(true) |
SecretKey | String | Your API token. | api.SecretKey("123abc") |
Detailed struct field information can be found in the wiki.