Skip to content
master
Switch branches/tags
Code
This branch is up to date with master.
Contribute

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.

gomo - a Go Client for the Moltin API

GoDoc Report Card Maintainability Test Coverage

A Golang client for the moltin API.

go get github.com/moltin/gomo

Documentation

Reference documentation is available on GoDoc.

client := gomo.NewClient(
	gomo.ClientCredentials(
		os.Getenv("MOLTIN_CLIENT_ID"),
		os.Getenv("MOLTIN_CLIENT_SECRET"),
	),
)

if err := client.Authenticate(); err != nil {
	log.Fatal(err)
}

products := []entities.Product{}
err := client.Get("products", gomo.Data(&products))
if err != nil {
	log.Fatal(err)
}

log.Printf("Found %d products\n", len(products))

Testing

In order to fully test the package, you will need a Moltin account to add your credentials to an environment file:

cp .env.example .env

Add your credentials and run:

source .env && go test ./...

If you do not supply a MOLTIN_CLIENT_ID and MOLTIN_CLIENT_SECRET, we will skip tests that leverage the live API.

About

A Go client for the Moltin API

Resources

License

Releases

No releases published

Packages

No packages published

Languages