README
¶
list-history-rw
Should be the same as the github repo name but it isn't always.
Introduction
What is this service and what is it for? What other services does it depend on
A microservice to write list history to MongoDB
Installation
How can I install it
Download the source code, dependencies and test dependencies:
go get -u github.com/kardianos/govendor
go get -u github.com/Financial-Times/list-history-rw
cd $GOPATH/src/github.com/Financial-Times/list-history-rw
govendor sync
go build .
Running locally
How can I run it
-
Run the tests and install the binary:
govendor sync govendor test -v -race go install -
Run the binary (using the
helpflag to see the available optional arguments):$GOPATH/bin/list-history-rw [--help]
Options:
--app-system-code="list-history-rw" System Code of the application ($APP_SYSTEM_CODE)
--app-name="list-history-rw" Application name ($APP_NAME)
--port="8080" Port to listen on ($APP_PORT)
-
Test:
-
Either using curl:
curl http://localhost:8080/people/143ba45c-2fb3-35bc-b227-a6ed80b5c517 | json_pp -
Or using httpie:
http GET http://localhost:8080/people/143ba45c-2fb3-35bc-b227-a6ed80b5c517
-
Build and deployment
How can I build and deploy it (lots of this will be links out as the steps will be common)
- Built by Docker Hub on merge to master: coco/list-history-rw
- CI provided by CircleCI: list-history-rw
Service endpoints
What are the endpoints offered by the service
e.g.
GET
Using curl:
curl http://localhost:8080/people/143ba45c-2fb3-35bc-b227-a6ed80b5c517 | json_pp`
Or using httpie:
http GET http://localhost:8080/people/143ba45c-2fb3-35bc-b227-a6ed80b5c517
The expected response will contain information about the person, and the organisations they are connected to (via memberships).
Based on the following google doc.
Utility endpoints
Endpoints that are there for support or testing, e.g read endpoints on the writers
Healthchecks
Admin endpoints are:
/__gtg
/__health
/__build-info
These standard endpoints do not need to be specifically documented.
This section should however explain what checks are done to determine health and gtg status.
There are several checks performed:
e.g.
- Checks that a connection can be made to Neo4j, using the neo4j url supplied as a parameter in service startup.
Other information
Anything else you want to add.
e.g. (NB: this example may be something we want to extract as it's probably common to a lot of services)
Logging
- The application uses logrus; the log file is initialised in main.go.
- Logging requires an
envapp parameter, for all environments other thanlocallogs are written to file. - When running locally, logs are written to console. If you want to log locally to file, you need to pass in an env parameter that is !=
local. - NOTE:
/__build-infoand/__gtgendpoints are not logged as they are called every second from varnish/vulcand and this information is not needed in logs/splunk.
Documentation
¶
There is no documentation for this package.
