top
(README.md)
# topics-transformer

[![Circle CI](https://circleci.com/gh/Financial-Times/topics-transformer/tree/master.png?style=shield)](https://circleci.com/gh/Financial-Times/topics-transformer/tree/master)

Retrieves Topics taxonomy from TME and transforms the topics to the internal UP json model.
The service exposes endpoints for getting all the topics and for getting topic by uuid.

# How to run
`go get github.com/Financial-Times/topics-transformer`

`$GOPATH/bin/ ./topics-transformer.exe  --base-url=http://localhost:8080/transformers/topics/ --tme-base-url=<TME URL> --tme-username=<USER> --tme-password=<PWD> --token=<TOKEN> --port=8080 --maxRecords=1000 --slices=10 `                

```
export|set PORT=8080
export|set BASE_URL="http://localhost:8080/transformers/topics/"
export|set TME_BASE_URL="http://tme.ft.com"
export|set TME_USERNAME="user"
export|set TME_PASSWORD="pass"
export|set TOKEN="token"
export|set MAX_RECORDS="10"
$GOPATH/bin/topics-transformer
```

With Docker:

`docker build -t coco/topics-transformer .`

`docker run -ti --env BASE_URL=<base url> --env TME_BASE_URL=<TME URL> --env TME_USERNAME=<user> --env TME_PASSWORD=<pass> --env TOKEN=<token> -env MAX_RECORDS=<recors> coco/topics-transformer`

#Usage

Get all topics:
`curl -X GET -H "Cache-Control: no-cache" -H "Postman-Token: 4f5f5bec-91ae-d714-3fb5-49b6e09a5a1b" "https://semantic-up.ft.com/__topics-transformer/transformers/topics"`

Get by topic:
`curl -X GET -H "Cache-Control: no-cache" -H "Postman-Token: 4f5f5bec-91ae-d714-3fb5-49b6e09a5a1b" "https://semantic-up.ft.com/__topics-transformer/transformers/topics/0205c4dd-5430-33ac-bb1f-fbfc347b1475"`

Imports 10 package(s)

  1. github.com/Financial-Times/service-status-go/httphandlers
  2. github.com/jawher/mow.cli
  3. github.com/rcrowley/go-metrics
  4. github.com/pborman/uuid
  5. github.com/Financial-Times/tme-reader/tmereader
  6. github.com/Sirupsen/logrus
  7. github.com/Financial-Times/go-fthealth/v1a
  8. github.com/Financial-Times/http-handlers-go/httphandlers
  9. github.com/sethgrid/pester
  10. github.com/gorilla/mux

Test imports 1 package(s)

  1. github.com/stretchr/testify/assert