1.0.1 • Published 7 years ago

fortune-datastore v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Code Climate

Fortune Google Cloud Datastore Adapter

This is a Google Cloud Datastore adapter for Fortune.

Usage

Install the fortune-datastore package from npm or yarn:

$ npm install fortune-datastore

or

$ yarn add fortune-datastore

Then use it with Fortune:

import fortune from 'fortune'
import datastoreAdapter from 'fortune-datastore'

const store = fortune({...},  {
  adapter: [
    datastoreAdapter,
    {
      projectId: 'my-gcp-project-id',
      keyFilename: 'gae_service_account_key.json',
      namespace: 'fortune-adapter-test'
    }
  ]
})

Adapter Options

EventDescription
generateIdGenerate the id key on a new record. It must be a function that accepts one argument, the record type, and returns a unique string or number. Optional.
projectIdThe project ID from the Google Developer's Console, e.g. 'grape-spaceship-123'. We will also check the environment variable GCLOUD_PROJECT for your project ID. If your app is running in an environment which supports Application Default Credentials, your project ID will be detected automatically.
keyFilenameFull path to the a .json, .pem, or .p12 key downloaded from the Google Developers Console. If you provide a path to a JSON file, the projectId option above is not necessary. NOTE: .pem and .p12 require you to specify options.email as well.
namespaceNamespace to isolate transactions to.

License

This software is licensed under the MIT License.