memberships-rw-neo4j

command module
v0.0.0-...-a00b21a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2018 License: MIT Imports: 10 Imported by: 0

README

Memberships Reader/Writer for Neo4j (memberships-rw-neo4j) [RETIRED]

An API for reading/writing memberships into Neo4j. Expects the memberships json supplied to be in the format that comes out of the memberships transformer.

Circle CIGo Report Card Coverage Status

Installation

For the first time:

go get github.com/Financial-Times/memberships-rw-neo4j

or update:

go get -u github.com/Financial-Times/memberships-rw-neo4j

Running

  1. Download the code.

  2. Build it:

     go install
    
  3. Download, install and start neo4j (otherwise the app will panic and exit).

  4. Run it:

     $GOPATH/bin/memberships-rw-neo4j --neo-url={neo4jUrl} --port={port} --batchSize=50 --timeoutMs=20
    

All arguments are optional, they default to a local Neo4j install on the default port (7474), application running on port 8080, batchSize of 1024 and timeoutMs of 50. NB: the default batchSize is much higher than the throughput the instance data ingester currently can cope with.

Updating the model

Use gojson against a transformer endpoint to create a person struct and update the model.go file. NB: we DO need a separate identifier struct.

curl http://ftaps35629-law1a-eu-t:8080/transformers/memberships/g10e101c-dbcf-356f-929e-669573defa56

Building

This service is built and deployed via Jenkins. The build chain can be found at JOBS-memberships-rw-neo4j.

The build works via git tags. To prepare a new release:

  1. update the version in the Modulefile, e.g. to 0.0.12.
  2. git tag that commit using git tag 0.0.12
  3. git push --tags

The deploy also works via git tag and you can also select the environment to deploy to.

Try it!

Note the data in the example (e.g. UUIDs) is not real.

View your data in the database
MATCH (m:Membership {uuid:"g10e101c-dbcf-356f-929e-669573defa56"}) RETURN m
Logging

The application uses logrus, the log file is initialised in main.go. Logging requires an env app parameter, for all environments other than local logs are written to file. When running locally, logging is written to console (if you want to log locally to file you need to pass in an env parameter that is != local.)

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL