Writes any raw content/data from native CMS in mongoDB without transformation.
10K+
Writes any raw content/data from native CMS in mongoDB without transformation. The same data can then be read from here just like from the original CMS.
You need Go to be installed. Please read about Go and about How to Write Go Code before jumping right in. For example you will need Git, Mercurial, Bazaar installed and working, so that Go can use them to retrieve dependencies. For this additionally you will also need a computer etc. Hope this helps.
For the first time: go get github.com/Financial-Times/nativerw and dep ensure -vendor-only.
go install github.com/Financial-Times/nativerw
CGO_ENABLED=0 go build -a -installsuffix cgo -o nativerw .
docker build -t coco/nativerw .
The following params can be injected in the nativerw app on startup through environment variables:
MONGOS This env var is mandatory. Mongo addresses to connect to in format: host1:port1[,host2:port2,...] the app will exit (with exit code 1) it is not valid. The MONGOS value is considered to be valid if the number of provided URLs matches the provided MONGO_NODE_COUNT and each MongoDb URL has host:port.MONGO_NODE_COUNT The number of MongoDB instances. Default value is 3.CONFIG Config file in json format. If not set, the default config.json will be used.The nativerw supports the following endpoints:
/{collection}/{uuid} retrieves the native document, and returns it in either json or binary (depending on how it is saved)./{collection}/{uuid} upserts a new native document for the given uuid./{collection}/__ids returns all uuids for the given collection on a best efforts basis. If the collection is very large, the endpoint is likely to time out (timeout duration is hardcoded to 10s) before all uuids have been returned. This will be indistinguishable from a request which sends back the complete set of uuids, however, if there are less than ~10,000 uuids returned, you can be fairly confident you have the entire set./__gtg the good to go endpoint./__health the health endpoint.Content type
Image
Digest
sha256:7318c9d06…
Size
10.1 MB
Last updated
4 months ago
docker pull coco/nativerw