Categorygithub.com/ONSdigital/dp-code-list-api
repositorypackage
2.13.0+incompatible
Repository: https://github.com/onsdigital/dp-code-list-api.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# README

dp-code-list-api

An API used to navigate code lists

Installation

Database

  • Run brew install neo4j
  • Configure neo4j, edit /usr/local/Cellar/neo4j/*/libexec/conf/neo4j.conf
  • Set dbms.security.auth_enabled=false
  • Run brew services restart neo4j

Getting started

  1. Import the relevant code-list data using the code list scripts.

  2. Run make debug (or make acceptance when running acceptance tests)

Healthcheck

The endpoint /health checks the connection to the database and returns one of:

  • success (200, JSON "status":"OK")
  • warning (429, JSON "status":"WARNING")
  • failure (500, JSON "status":"CRITICAL")

Configuration

Environment variableDefaultDescription
BIND_ADDR:22400The host and port to bind to
CODE_LIST_API_URLhttp://localhost:22400The base URL for the code list API
DATASET_API_URLhttp://localhost:22000The base URL for the dataset API
GRACEFUL_SHUTDOWN_TIMEOUT5sThe graceful shutdown timeout in seconds
HEALTHCHECK_INTERVAL30sTime between calls to healthchecks
HEALTHCHECK_CRITICAL_TIMEOUT90sTimeout to consider a failing healthcheck critical
DEFAULT_MAXIMUM_LIMIT1000Default maximum limit for pagination
DEFAULT_LIMIT20Default limit for pagination
DEFAULT_OFFSET0Default offset for pagination
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317Endpoint for OpenTelemetry service
OTEL_SERVICE_NAMEdp-code-list-apiLabel of service for OpenTelemetry service
OTEL_BATCH_TIMEOUT5sTimeout for OpenTelemetry
OTEL_ENABLEDfalseFeature flag to enable OpenTelemetry

Graph / Neptune Configuration

Environment variableDefaultDescription
GRAPH_DRIVER_TYPE""string identifier for the implementation to be used (e.g. 'neptune' or 'mock')
GRAPH_ADDR""address of the database matching the chosen driver type (web socket)
NEPTUNE_TLS_SKIP_VERIFYfalseflag to skip TLS certificate verification, should only be true when run locally

:warning: to connect to a remote Neptune environment on MacOSX using Go 1.18 or higher you must set NEPTUNE_TLS_SKIP_VERIFY to true. See our Neptune guide for more details.

License

Copyright © 2016-2021, Office for National Statistics (https://www.ons.gov.uk)

Released under MIT license, see LICENSE for details.