list-notifications-rw

command module
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: MIT Imports: 13 Imported by: 0

README

List Notifications R/W

CircleCI Go Report Card Coverage Status codecov

Responsible for serving and writing notifications for lists. Similar in functionality to the Java-based notifications-rw.

Installation

go get github.com/Financial-Times/list-notifications-rw

Build

go build

Test

go test -v -race ./...

Running Locally

The list-notifications-rw requires access to Atlas MongoDB. Update the environment variable DB_CLUSTER_ADDRESS field to point to the Atlas MongoDB cluster. To run, simply build and run:

./list-notifications-rw

N.B. This assumes your config.yml is in your working directory.

The default port is 8080, but can be configured in the environment variables.

API

Write a new list notification:

curl http://localhost:8080/lists/notifications/{uuid} -XPUT --data '$json'

Where $json is a valid internal list in json format. To get example list data, see sample-list.json or get an example from the Atlas MongoDB lists collection.

Read notifications:

curl http://localhost:8080/lists/notifications?since=$date

Where $date is a date in RFC3339 format which is within the last 3 months. For an example date, simply hit the /lists/notifications endpoint with no since parameter. ( e.g. since=2016-11-02T12:41:47.4692365Z )

To see healthcheck results:

curl http://localhost:8080/__health

Is it good to go?

curl http://localhost:8080/__gtg

N.B. In an actual setup environment, going directly to the service (rather than through API Policy Component) will yield more information (i.e. lastModified and publishReference).

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