项目作者: f-f

项目描述 :
Auto-generated Google APIs for Clojure
高级语言: Clojure
项目地址: git://github.com/f-f/gogolica.git
创建时间: 2017-09-16T15:27:20Z
项目社区:https://github.com/f-f/gogolica

开源协议:Eclipse Public License 1.0

下载


Gogolica

Always think of what is useful and not what is beautiful.
Beauty will come of its own accord.

Nikolai Vasilievich Gogol

You can’t imagine how stupid the whole world has grown nowadays.

Also Nikolai Vasilievich Gogol



CircleCI

Warning: ALPHA STATUS

Gogolica is an auto-generated Clojure bindings library for Google APIs.

The implemented APIs are the ones provided from the Google Discovery Service’s
JSON description files of the available “new style” Google APIs.

The generator itself and the code it produces are Alpha.

Some APIs are alpha/beta, and indicated as such in the namespace
(e.g., “gogolica.storage.v1alpha”).

Available APIs

None yet.

Usage

gogolica.storage.v1

  1. (require '[gogolica.storage.v1 :as gcs])
  2. ;; Authentication, if you have the env variable GOOGLE_APPLICATION_DEFAULT set,
  3. ;; then your service account key will be read from the path specified in it.
  4. ;; Otherwise you can load it manually:
  5. (gogolica.core.auth/key-from-file "path/to/key.json")
  6. ;; List buckets for your project
  7. (gcs/buckets-list "my-project-name" {})
  8. ;; List objects for a buckets
  9. (gcs/objects-list "my-bucket-name" {})
  10. ;; Create new bucket
  11. (gcs/buckets-insert {:name "my-new-bucket-name"} "my-project-name" {})
  12. ;; Upload a new object
  13. (gcs/objects-insert "/absolute/path/to/file.png" {} "my-new-bucket-name" {:name "my-file-name"})
  14. ;; Download the new object - metadata
  15. (gcs/objects-get "my-new-bucket-name" "my-file-name" {})
  16. ;; Download the new object - data as bytearray
  17. (gcs/objects-get "my-new-bucket-name" "my-file-name" {:alt "media"})

Developing

Getting the JSON models for Google APIs

This will clone the Google auto-generated Go library in the vendor directory,
and copy over their versioned json models to the model folder.

  1. ./script/copy-models

TODO

TODO

Testing

Unit tests (test pure functions)

  1. lein test

Integration tests (test hitting APIs)

TODO

License

Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version.