A Go SDK for logistics emissions data compatible with the iLEAP Technical Specifications.
- Support for PACT Product Footprints with iLEAP extensions.
- Support for iLEAP Transport Activity Data
$ go get github.com/way-platform/ileap-go@latestclient := ileap.NewClient(
ileap.WithBaseURL(os.Getenv("BASE_URL")),
ileap.WithOAuth2(os.Getenv("CLIENT_ID"), os.Getenv("CLIENT_SECRET")),
)
footprint, err := client.GetFootprint(context.Background(), &ileap.GetFootprintRequest{
ID: "91715e5e-fd0b-4d1c-8fab-76290c46e6ed",
})
if err != nil {
// TODO: Handle error.
}
fmt.Println(footprint)The project is built using Mage, see magefile.go.
$ go tool mage buildFor all available build tasks, see:
$ go tool magego install github.com/way-platform/ileap-go/cmd/ileap@latestPrebuilt binaries for Linux, Windows, and Mac are available from the Releases.
The following example logs in to the SINE Foundation's demo API.
$ ileap auth login \
--base-url https://ileap.wayplatform.com \
--client-id hello \
--client-secret pathfinder
Logged in to https://api.ileap.sine.dev.$ ileap footprint 91715e5e-fd0b-4d1c-8fab-76290c46e6ed
{
"data": {
"id": "91715e5e-fd0b-4d1c-8fab-76290c46e6ed",
"specVersion": "2.0.0",
"version": 1,
"created": "2022-03-01T09:32:20Z",
"status": "Active",
"validityPeriodStart": "2022-03-01T09:32:20Z",
"validityPeriodEnd": "2024-12-31T00:00:00Z",
"companyName": "My Corp",
"companyIds": [
"urn:uuid:69585GB6-56T9-6958-E526-6FDGZJHU1326",
"urn:epc:id:sgln:562958.00000.4"
],
"productDescription": "Bio-Ethanol 98%, corn feedstock (bulk - no packaging)",
"..."
}