generate a complete contentful SDK client from your existing schema
- generates typed contentful content delivery api SDK
- generates typed contentful content preview api SDK
- generates typed contentful content management api SDK
- supports recursive type definitions
- supports assets
go get -u github.com/nicolai86/go-contentful-generator
See the test folder for an example usage as well as an example client.
first, export the necessary credentials into your env:
$ export CONTENTFUL_SPACE_ID=awesome-space
$ export CONTENTFUL_AUTH_TOKEN=secret-token
the CONTENTFUL_AUTH_TOKEN
has to be for the CMA.
Then generate your package:
$ go-contentful-generator -pkg contentful -o contentful.go
Or, you can use a go-generate flag like this:
//go:generate go-contentful-generator -pkg main -o contentful.go
- multi-language schema
- content-type management
- tests