draft-content-suggestions
Introduction
Draft Content Suggestions as a microservice, provides consolidated suggestions via fetching draft content
from Draft Content service and querying Suggestions Umbrella service.
Installation
Download the source code, dependencies and test dependencies:
go get github.com:Financial-Times/draft-content-suggestions
cd $GOPATH/src/github.com/Financial-Times/draft-content-suggestions
go build .
Running locally
-
Run the tests and install the binary:
go test ./...
go install
-
Run the binary (using the help
flag to see the available optional arguments):
$GOPATH/bin/draft-content-suggestions [--help]
Options:
--app-system-code="draft-content-suggestions" System Code of the application ($APP_SYSTEM_CODE)
--app-name="Annotation Suggestions API" Application name ($APP_NAME)
--port="8080" Port to listen on ($APP_PORT)
--draft-content-endpoint="http://localhost:9000/drafts/content" Draft Content Service
--draft-content-gtg-endpoint="http://localhost:9000/__gtg" Draft Content Health Service
--suggestions-umbrella-endpoint="http://test.api.ft.com/content/suggest" Suggestions Umbrella Service
--suggestions-api-key="" Suggestions service apiKey
-
Test:
-
Either using curl:
curl http://localhost:8080/drafts/content/143ba45c-2fb3-35bc-b227-a6ed80b5c517/suggestions | json_pp
-
Or using httpie:
http GET http://localhost:8080/drafts/content/143ba45c-2fb3-35bc-b227-a6ed80b5c517/suggestions
Build and deployment
How can I build and deploy it (lots of this will be links out as the steps will be common)
API
For detailed documentation in OpenAPI format, please see here.
Logging
- The application uses go-logger/v2; the log library is initialised in main.go.
- NOTE:
/__build-info
and /__gtg
endpoints are not logged as they are called every second from varnish/vulcand and this information is not needed in logs/splunk.
Change/Rotate sealed secrets
Please reffer to documentation in pac-global-sealed-secrets-eks. Here are explained details how to create new, change existing sealed secrets.