dp-search-reindex-api

command module
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2021 License: MIT Imports: 7 Imported by: 0

README

dp-search-reindex-api

Provides detail about search reindex jobs and enables creation and running of them

Getting started
  • Set up dependencies then run make debug
Dependencies
  • Requires MongoDB running on port 27017
  • No further dependencies other than those defined in go.mod
Configuration
Environment variable Default Description
BIND_ADDR :25700 The host and port to bind to
GRACEFUL_SHUTDOWN_TIMEOUT 20s The graceful shutdown timeout in seconds (time.Duration format)
HEALTHCHECK_INTERVAL 30s Time between self-healthchecks (time.Duration format)
HEALTHCHECK_CRITICAL_TIMEOUT 90s Time to wait until an unhealthy dependent propagates its state to make this app unhealthy (time.Duration format)
MAX_REINDEX_JOB_RUNTIME 3600s The maximum amount of time that a reindex job is allowed to run before another reindex job can be started
MONGODB_BIND_ADDR localhost:27017 The MongoDB bind address
MONGODB_COLLECTION jobs MongoDB collection
MONGODB_LOCKS_COLLECTION jobs_locks MongoDB locks collection
MONGODB_DATABASE search The MongoDB search database
DEFAULT_MAXIMUM_LIMIT 1000 The maximum number of reindex jobs to be returned in any list (to prevent performance issues)
DEFAULT_LIMIT 20 The maximum number of reindex jobs to be returned in a particular list (for a particular request)
DEFAULT_OFFSET 0 The number of reindex jobs into the full list (i.e. the 0-based index) that a particular response is starting at
Testing
  • Run the component tests with this command go test -component
  • Run the unit tests with this command make test

Postman can be used to test that the endpoints all work as defined in the swagger (replace "ID" with the id value where applicable):

Contributing

See CONTRIBUTING for details.

License

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

Released under MIT license, see LICENSE for details.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
features
steps
Package steps is used to define the steps that are used in the component test, which is written in godog (Go's version of cucumber).
Package steps is used to define the steps that are used in the component test, which is written in godog (Go's version of cucumber).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL