Welcome to the HDR UK Gateway Metadata Integrations, a Go application that allows integration into the Gateway datasets HDR UK Gateway. This application facilitates seamless interaction with data custodian endpoints, whether authorized or unauthorized, and passes the data into the Gateway API to be translated into the latest schema version before being added as a dataset in the Gateway.
This project utilizes Go as the language of choice for its robust capabilities and memory-safe stability.
Follow these steps to run the project on your local machine.
Ensure you have the following installed:
- Go (Latest version) – More info here
Open a terminal and execute:
git clone https://github.com/HDRUK/gateway-metadata-integrationscd gateway-metadata-integrationsCreate a .env file and populate it with appropriate values, using .env.example as a reference.
go mod tidyRun the application using:
go run main.goIn the project directory, you can run the following commands:
go run main.go– Starts the application.go build– Builds the application for production.go test ./...– Runs the Go test suite.
A brief overview of the project's folder structure:
├── pkg/pull/ # Pull methods
├── pkg/push/ # Push methods
├── pkg/routes/ # Routing methods
├── pkg/secrets/ # Secret methods ...shhh..
├── pkg/utils/ # Common utils and mocks
├── pkg/validator/ # Validation methods
├── tests/ # Unit tests
├── .env.example # Sample environment variables file
├── go.mod # Go module dependencies
├── go.sum # Checksums for dependencies
├── main.go # Application entry point
└── README.md # Project documentation
We use Go's built-in testing package for unit and integration testing.
To run tests:
go test ./testsFor further support, please reach out via HDR UK or raise a bug or even better, submit a PR!