go.mercari.io/datastore@v1.8.2/README.md (about)

     1  # Datastore Wrapper [![Go Documentation](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)][godoc] [![CircleCI](https://circleci.com/gh/mercari/datastore.svg?style=svg)][circleci]
     2  
     3  [godoc]: https://godoc.org/go.mercari.io/datastore
     4  [circleci]: https://circleci.com/gh/mercari/datastore
     5  
     6  (AppEngine | Cloud) Datastore wrapper for Go 👉
     7  
     8  Simple.
     9  Happy.
    10  Respect standard library.
    11  
    12  ```
    13  $ go get -u go.mercari.io/datastore
    14  ```
    15  
    16  ## Feature
    17  
    18  ### DO
    19  
    20  * Wrap `google.golang.org/appengine/datastore` and `cloud.google.com/go/datastore`
    21      * keep key behavior
    22      * align to `cloud.google.com/go/datastore` first
    23  * Re-implement datastore package
    24  * Re-implement datastore.SaveStruct & LoadStruct
    25      * Ignore unmapped property
    26      * Add PropertyTranslator interface
    27          * Convert types like mytime.Unix to time.Time and reverse it
    28          * Rename property like CreatedAt to createdAt or created_at and reverse it
    29  * Re-implement PropertyLoadSaver
    30      * Pass context.Context to Save & Load method
    31  * Add retry feature to each RPC
    32      * e.g. Retry AllocateID when it failed
    33  * Add middleware layer
    34      * About...
    35          * Local Cache
    36          * AE Memcache
    37          * Logging
    38          * Retry
    39          * etc...
    40      * Easy to ON/OFF switching
    41  * Add some useful methods
    42      * `aedatastore/TransactionContext`
    43  
    44  ### DON'T
    45  
    46  * have utility functions
    47  * support firestore
    48  
    49  ## Restriction
    50  
    51  * `aedatastore` package
    52      * When using slice of struct, MUST specified `datastore:",flatten"` option.
    53          * original (ae & cloud) datastore.SaveStruct have different behaviors.
    54          * see aeprodtest/main.go `/api/test3`
    55  
    56  ## Committers
    57  
    58   * Masahiro Wakame ([@vvakame](https://github.com/vvakame))
    59  
    60  ## Contribution
    61  
    62  Please read the CLA below carefully before submitting your contribution.
    63  
    64  https://www.mercari.com/cla/
    65  
    66  ### Setup environment & Run tests
    67  
    68  * requirements
    69      * [gcloud sdk](https://cloud.google.com/sdk/docs/quickstarts)
    70          * `gcloud components install app-engine-go`
    71          * `gcloud components install beta cloud-datastore-emulator`
    72  
    73  1. Testing in local
    74  
    75  ```
    76  $ ./setup.sh # exec once
    77  $ ./serve.sh # exec in background
    78  $ ./test.sh
    79  ```
    80  
    81  2. Testing with [Circle CI CLI](https://circleci.com/docs/2.0/local-jobs/)
    82  
    83  ```
    84  $ circleci build
    85  ```
    86  
    87  ## License
    88  
    89  Copyright 2017 Mercari, Inc.
    90  
    91  Licensed under the MIT License.