Simple document upload and search service.
Create a simple service that allows to upload text files and search which text files contain a specified word.
See Quick start quite below to find out how to start service.
API documentation is available as Swagger spec file. Test files for upload available in e2e/testdata directory.
Important note: by default, file indexing engine omits common verbs and articles in English language to reduce index size.
You can control this behavior by changing ignore_common_words
parameter in config file.
- Go 1.17+
- GNU Make (BSD also might work)
- Redis (or docker-compose)
Ensure that you have docker-compose and latest Go versions installed.
- Clone this repo
- Create containers with dependencies using
docker-compose up -d
(only once) - Start containers with
docker-compose start
- Run project using
make run
Service HTTP listen address is specified in default development config (see config.dev.yml)
Use make test
to run unit tests.
Mocks can be updated using make gen
command.
End-to-end tests are located at e2e directory.
Use make e2e
to run end-to-end tests.
Warning: E2E tests require Redis. Please start docker-compose containers using docker-compose start
before running end-to-end tests.