insolvency-api

command module
v0.0.0-...-440c973 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: MIT Imports: 13 Imported by: 0

README

Insolvency API

GoDoc Go Report Card

API code and specification for submitting insolvency data to Companies House

Requirements

The recommended way to run this API is via the CHS Docker development mechanism (see here for more details).

In order to run this API locally, however, you would need to install the following:

Running Locally with Docker CHS

Clone Docker CHS Development and follow the steps in the README.

Enable the insolvency module.

As this is an ERIC-routed service, call endpoints via the base url of: http://api.chs.local:4001. To check things are running, you might wish to try the healthcheck endpoint: {base_url}/insolvency/healthcheck

Development mode is available for this service in Docker CHS Development.

./bin/chs-dev development enable insolvency-api

Pull image from private CH registry by running docker pull 169942020521.dkr.ecr.eu-west-1.amazonaws.com/local/insolvency-api:latest command or run the following steps to build image locally:

  1. export SSH_PRIVATE_KEY_PASSPHRASE='[your SSH key passhprase goes here]' (optional, set only if SSH key is passphrase protected)
  2. DOCKER_BUILDKIT=0 docker build --build-arg SSH_PRIVATE_KEY="$(cat ~/.ssh/id_rsa)" --build-arg SSH_PRIVATE_KEY_PASSPHRASE -t 169942020521.dkr.ecr.eu-west-1.amazonaws.com/local/insolvency-api .
  3. docker run 169942020521.dkr.ecr.eu-west-1.amazonaws.com/local/insolvency-api:latest

However, this service has multiple dependencies e.g. on ERIC, Transactions API, Company Lookup, and EFS Submission API, so simply will not work in isolation.

  1. Clone this repository: go get github.com/companieshouse/insolvency-api
  2. Build the executable: make build

The same microservice dependecy considerations apply as with local Docker builds - this service is not intended to run in isolation.

Configuration

Variable Default Description
BIND_ADDR - Insolvency API Port
MONGODB_URL - MongoDB URL
INSOLVENCY_MONGODB_DATABASE - MongoDB database name
INSOLVENCY_MONGODB_COLLECTION - MongoDB collection name

Spec

When this service is live, specs will be available on the Companies House Developer Hub. As a courtesy during development, an OpenAPI 3 spec has been included in the /apispec folder, along with a description of how to use this API alongside the Transactions API (the Insolvency API is inseparable from that wider transactions-based model).

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package config defines the environment variable and command-line flags
Package config defines the environment variable and command-line flags
Package constants contains enums for validation
Package constants contains enums for validation
Package handlers contains the http handlers which receive requests to be processed by the API.
Package handlers contains the http handlers which receive requests to be processed by the API.
Package interceptors contains the interceptor middleware that checks for authorisation.
Package interceptors contains the interceptor middleware that checks for authorisation.

Jump to

Keyboard shortcuts

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