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

# README

dp-frontend-renderer

Deprecation

The renderer is being deprecated, the template and toml (localisation) files are to be migrated to the relevant controller/service.

Refer to the migration readme for further information.

Configuration

Environment variableDefaultDescription
BIND_ADDR:20010The host and port to bind to
DEBUGfalseEnable debug mode
SITE_DOMAINons.gov.ukDomain for the website
PATTERN_LIBRARY_ASSETS_PATHPattern library location
SUPPORTED_LANGUAGES[2]string{"en", "cy"}languages supported
GRACEFUL_SHUTDOWN_TIMEOUT5sThe graceful shutdown timeout
HEALTHCHECK_INTERVAL30sTime between calls to healthchecks
HEALTHCHECK_CRITICAL_TIMEOUT90sTimeout to consider a failing healthcheck critical

Adding new page types

  1. Create the page model in dp-frontend-models
  • you'll need to update the vendored copy - govendor update github.com/ONSdigital/dp-frontend-models
  1. Create a new handler - use handlers/homepage/handler.go as an example
  • render.Handler will take care of setting global variables, e.g. language
  • the func() passed in should be used for any page-specific customisations
  1. Create a route in main.go

NOTE: Code development / testing

Vscode in helpers.go and service.go does not see assets.Asset and assets.AssetNames so debugging won't play ball, and this is expected because the command line make commands utilise go generate to create the required functions in data.go ...

So - at the command line, make debug, etc are OK.

Licence

Copyright ©‎ 2016, 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

# Functions

Asset loads and returns the asset for the given name.
AssetDir returns the file names below a certain directory embedded in the file by go-bindata.
AssetInfo loads and returns the asset info for the given name.
AssetNames returns the names of the assets.
No description provided by the author
No description provided by the author
MustAsset is like Asset but panics when Asset would return an error.
RestoreAsset restores an asset under the given directory.
RestoreAssets restores an asset under the given directory recursively.

# 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.