Categorygithub.com/ONSdigital/dp-table-renderer
modulepackage
1.8.0
Repository: https://github.com/onsdigital/dp-table-renderer.git
Documentation: pkg.go.dev

# README

dp-table-renderer

Given json defining a table, capable of rendering a table in multiple formats

Getting started

Environment variableDefaultDescription
BIND_ADDR:23300The host and port to bind to
HEALTH_CHECK_INTERVALInterval between health checks30 seconds
HEALTH_CHECK_CRITICAL_TIMEOUTAmount of time to pass since last healthy health check to be deemed a critical failure90 seconds
CORS_ALLOWED_ORIGINS*The allowed origins for CORS requests
SHUTDOWN_TIMEOUT5sThe graceful shutdown timeout (time.Duration format)

Endpoints

urlMethodParameter valuesDescription
/render/{render_type}POSTrender_type = html, csv, or xlsxRenders the (json) data provided in the post body as a table in the requested format
/parse/htmlPOSTParses an html table and returns the json format suitable for sending to the /render endpoint

See the swagger.yaml file for a full definition (use http://editor.swagger.io to make it easy to read), and see the json files in the testdata directory for example requests.

/render/{render_type}

Merged cells can be specified using colspan and rowspan properties of cell_format elements. Please note that the data array should include all cells (i.e. each row should contain the same number of cells), even if some of them have been merged. This is the same approach/format used by some javascript spreadsheet components such as Handsontable.

/parse/html

Please note that the is assumed to include all cells (i.e. each row should contain the same number of cells), even if some of them have been hidden by merged cells. This is the same approach/format used by some javascript spreadsheet components such as Handsontable. The response contains the html generated by /render/html as well as the json required to call that endpoint.

Healthchecking

Currently, reported on endpoint /healthcheck. There are no other services consumed, so it will always return OK.

Contributing

See CONTRIBUTING for details.

License

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

Released under MIT license, see LICENSE for details.

# 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
No description provided by the author

# Variables

BuildTime represents the time in which the service was built.
GitCommit represents the commit (SHA-1) hash of the service that is running.
Version represents the version of the service that is running.