Skip to content

brendanhay/gogol

Repository files navigation

Gogol

Hackage Version

Description

A comprehensive Google Services SDK for Haskell supporting all of the publicly available services.

Documentation

You can find the latest stable release documentation for each respective library on Hackage under the Google section.

Organisation

This repository is organised into the following directory structure:

  • lib/gogol: Actual operational logic, you'll need to import this to send requests etc.
  • lib/gogol-core: The gogol-core library upon which each of the services depends.
  • lib/services/gogol-*: Data types for each of the individual Google Compute Engine Service libraries.
  • examples: A currently sparse collection of examples for the various services.
  • configs, Configuration, templates, and assets for the code generator.
  • gen: The code generation binary.
  • scripts: Scripts to manage the release lifecycle of the service libraries.

Change Log

A change log for the entire project can be found under gogol/CHANGELOG.md.

Contribute

For any problems, comments, or feedback please create an issue here on GitHub.

Code Generation

For pull requests which affect generated output, please do not include the actual regenerated service code, only commit the updates to the generator and related configuration.

This ensures the Continuous Integration process is the single source of truth for generated code changes, and keeps pull requests readable and focused on actual generator code/logic changes.

Adding New Services

The configuration for the generation step of each individual service endpoint lives under ./configs/services. The naming matches the Google Discovery Service naming of endpoints, which are vendored under ./configs/models.

Rather than actually crawling the Discovery Service, the Google API Go Client is vendored under ./vendor, and the JSON service definitions are copied to ./configs/models to ensure reproducibility of the generation steps and the abilitry to diff across versions.

Example: Cloud Dataproc

To add a new endpoint, first create the related JSON configuration in the ./configs/services directory.

Since the Cloud Dataproc API is called dataproc-api.json in the Google Discovery API, you would create the configuration ./configs/services/dataproc.json with the following contents:

{
 "library": "dataproc",
 "canonicalName": "Dataproc"
}

Then, the Makefile is used:

make clean
make

This will build the ./bin/gogol-gen binary, and will generate a Haskell library for each API that has matching ./configs/services/*.json configuration.

For the above example, the result would be a ./lib/services/gogol-dataproc directory at the top-level of the project containing the generated API client.

make full-clean can be used to cause a complete re-download of all (including new) service models.

Individual clients/SDKs can be generated by passing a specific MODELS environment variable to the make command, for example: MODELS=configs/models/admin/directory/v1/admin-api.json make

Licence

Gogol is released under the Mozilla Public License Version 2.0.

Parts of the code are derived from Google Compute Engine service descriptions, licensed under Apache 2.0. Source files subject to this contain an additional licensing clause in their header.