This is a file storage server for the MAXIT project.
Prerequisites:
- Docker
To build docker image for local usage run the following command:
docker build -t maxit/file-storage .- Go: Ensure you have Go installed on your machine (version 1.23.2).
To set up and run the File Storage API, follow these steps:
- Clone the Repository:
git clone https://github.com/mini-maxit/file-storage.git cd file-storage - Install Go Packages: Ensure all necessary Go packages are installed by running:
go mod tidy
- Environment Configuration: Copy the .env.dist file to .env:
Update the
cp .env.dist .env
.envfile with the necessary environment variables. - Run the Application: To run the application, you can use the prepared
Makefile. jut run:make
OpenAPI 3.0 specification: api.raml
When an error occurs, the response is returned in JSON format with the following structure:
{
"reason": "A brief explanation of the error",
"details": "A more detailed description of the error",
"context": {
"key": "value",
"key2": "value2"
}
}Field Descriptions:
- reason: A high-level message describing the cause of the error, such as "Failed to process task" or "Submission not found."
- details: A more specific message or description of the error, often based on the underlying issue (e.g., "Invalid task parameters").
- context: An optional field containing additional context information about the error. This might include values like taskID, userID, submissionNumber, or other key-value pairs that provide insight into the specific conditions under which the error occurred. This field is included when relevant context is available.