public-people-api

command module
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2016 License: MIT Imports: 15 Imported by: 0 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

Public API for People (public-people-api)

Generates JSON representation of a Person in public-friendly format.

Build & deployment

CircleCI

Installation & running locally

  1. Download the source code, dependencies and its test dependencies:

     go get -u github.com/Financial-Times/public-people-api
     cd $GOPATH/src/github.com/Financial-Times/public-people-api
     go get -t
    
  2. Run the tests and install the binary:

     go test ./...
     go install
    
  3. Run the binary (using the help flag to see the available optional arguments):

     $GOPATH/bin/public-people-api [--help]
    
  4. Test:

    1. Either using curl:

       curl http://localhost:8080/people/143ba45c-2fb3-35bc-b227-a6ed80b5c517 | json_pp
      
    2. Or using httpie:

       http GET http://localhost:8080/people/143ba45c-2fb3-35bc-b227-a6ed80b5c517
      

Endpoints

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.

Health Checks

Health checks: http://localhost:8080/__health

Logging
  • The application uses logrus; the log file is initialised in app.go.
  • Logging requires an env app parameter, for all environments other than local logs 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-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.

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