relations-api

command module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2017 License: MIT Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

CircleCI Coverage Status

relations-api

Relations Api is an internally used API for retrieving content collection content, that is content of curated relations or contains relations for a given content.

Usage

Install

go get -u github.com/Financial-Times/relations-api

Running locally

To run the service locally, you will need to run the following commands first to get the vendored dependencies for this project: go get github.com/kardianos/govendor and govendor sync

Usage: relations-api [OPTIONS]

Options:
  --neo-url="http://localhost:7474/db/data"   neo4j endpoint URL ($NEO_URL)
  --port="8080"                               Port to listen on ($PORT)
  --graphiteTCPAddress=""                     Graphite TCP address, e.g. graphite.ft.com:2003. Leave as default if you d
o NOT want to output to graphite (e.g. if running locally) ($GRAPHITE_ADDRESS)
  --graphitePrefix=""                         Prefix to use. Should start with content, include the environment, and the
 host name. e.g. coco.pre-prod.public-things-api.1 ($GRAPHITE_PREFIX)
  --logMetrics=false                          Whether to log metrics. Set to true if running locally and you want metric
s output ($LOG_METRICS)
  --cache-duration="30s"                      Duration Get requests should be cached for. e.g. 2h45m would set the max-a
ge value to '7440' seconds ($CACHE_DURATION)

Endpoints

Application specific endpoints:
  • /content/{uuid}/relations
Admin specific endpoints:
  • /ping
  • /build-info
  • /__ping
  • /__build-info
  • /__health
  • /__gtg

Example

GET https://pre-prod-uk-up.ft.com/__relations-api/content/9b6eb364-0275-11e7-b9ac-52b4e2bf8289/relations

{
       "curatedRelatedContent": [{
           "id": "http://api.ft.com/things/74bd05b4-edca-11e6-abbc-ee7d9c5b3b90",
           "apiUrl": "http://api.ft.com/content/74bd05b4-edca-11e6-abbc-ee7d9c5b3b90"
           }]
        "contains": [{
           "id": "http://api.ft.com/things/74bd05b4-edca-11e6-1234-ee7d9c5b3b90",
           "apiUrl": "http://api.ft.com/content/74bd05b4-edca-11e6-abbc-ee7d9c5b3b90"
           },
           {
           "id": "http://api.ft.com/things/74bd05b4-edca-11e6-1313-ee7d9c5b3b90",
           "apiUrl": "http://api.ft.com/content/74bd05b4-edca-11e6-abbc-ee7d9c5b3b90"
           }]
        "containedIn": [{
           "id": "http://api.ft.com/things/74bd05b4-adsd-1342-abbc-ee7d9c5b3b90",
           "apiUrl": "http://api.ft.com/content/74bd05b4-edca-11e6-abbc-ee7d9c5b3b90"
           }]
   }

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
⌂ 换网址