{"id":19693147,"url":"https://github.com/breadrock1/image-resizer","last_synced_at":"2026-06-09T18:31:52.349Z","repository":{"id":241572538,"uuid":"807073958","full_name":"breadrock1/image-resizer","owner":"breadrock1","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-28T13:19:40.000Z","size":195,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-05-29T04:15:57.809Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/breadrock1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-28T12:40:03.000Z","updated_at":"2024-05-29T04:16:04.950Z","dependencies_parsed_at":"2024-06-04T12:51:51.768Z","dependency_job_id":null,"html_url":"https://github.com/breadrock1/image-resizer","commit_stats":null,"previous_names":["breadrock1/image-resizer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/breadrock1/image-resizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/breadrock1%2Fimage-resizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/breadrock1%2Fimage-resizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/breadrock1%2Fimage-resizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/breadrock1%2Fimage-resizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/breadrock1","download_url":"https://codeload.github.com/breadrock1/image-resizer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/breadrock1%2Fimage-resizer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34121021,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T19:15:53.264Z","updated_at":"2026-06-09T18:31:52.327Z","avatar_url":"https://github.com/breadrock1.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Image Resizer Service\n[![Github Actions](https://github.com/breadrock1/image-resizer/actions/workflows/go.yml/badge.svg)](https://github.com/breadrock1/image-resizer/actions/workflows/go.yml) \n![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/breadrock1/image-resizer)\n\n## Description\nThe service is designed for making a preview (creating an image with new dimensions based on a colored image).\n\n## Architecture structure\nThe service is a web server (proxy) that loads images, scales/crops them to the desired format and returns them to the user.\n\n## Endpoint description\n\nThe service must receive the URL of the original image, download it, change it to the required size and return it as an HTTP response.\n - Works only with HTTP requests.\n - Proxy errors from the remote service and respond to the client with 502 Bad Gateway.\n - Support only JPEG image encoding.\n\nHttp `GET` request\n\n```http request\nhttp://localhost:2891/fill/{height}/{width}/{img-url}\n```\n\n## Cache\nThe service saves (cache) the received preview on the local disk and, when requested again, send the image from the disk, without a request to the remote HTTP server.\n\nSince the cache space is limited, the \"Least Recent Used\" algorithm must be used to remove rarely used images.\n\n## Configuration \n\nThere are multiple configurations parameters. It may be grouped by:\n - logger\n - server\n - cache\n - resizer\n - storage\n\nThere is example of `config.toml` file\n\n```toml\n[logger]\nLevel = \"INFO\"\nFilePath = \"logs/app.log\"\nEnableFileLog = false\n\n[server]\nHost=\"0.0.0.0\"\nHostPort=2891\n\n[cache]\nExpireSeconds=20\nCapacityValues=5\n\n[resizer]\nTargetQuality=90\n\n[storage]\nUseFilesystem=true\nUploadDirectory=\"uploads\"\n```\n\n## Launch and Deploy\n\nThe microservice should be deployed using the make run command (within docker compose up) in the project directory.\n\nBuild and run:\n```shell\nmake run\n```\n\nBuild and run docker container:\n```shell\nmake run-img\n```\n\nBuild and run by docker compose:\n```shell\nmake run-compose\n```\n\nRun linter:\n```shell\nmake lint\n```\n\nRun tests:\n```shell\nmake test\n```\n\n## Testing tasks\nIt is necessary to check the operation of the server in different scenarios:\n\n - the image was found in the cache;\n - the remote server does not exist;\n - the remote server exists, but the image was not found (404 Not Found);\n - the remote server exists, but the image is not an image, but, say, an exe file;\n - the remote server returned an error;\n - the remote server returned the image;\n - the image is smaller than the required size; etc.\n\n## Recension\nMaximum - 15 points (subject to fulfillment of mandatory requirements):\n\n - Implemented an HTTP server that proxies requests to a remote server - 2 points.\n - Implemented image slicing - 2 points.\n - Caching sliced images on disk - 1 point.\n - Cache limit by location (LRU cache) - 1 point.\n - The proxy server correctly transmits the request headers - 1 point.\n - Integration tests written - 3 points.\n - The tests are adequate and fully cover the functionality - 1 point.\n - The project can be built using make build, run using make run and tested using make test - 1 point.\n - Code clarity and purity - up to 3 points.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbreadrock1%2Fimage-resizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbreadrock1%2Fimage-resizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbreadrock1%2Fimage-resizer/lists"}