Skip to content

rossi1/image-resizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image Resizing Service

A high-performance image resizing service that processes images asynchronously with caching support.

Features

  • Resize multiple images in parallel
  • Asynchronous processing with job status tracking
  • LRU caching for improved performance
  • RESTful API with JSON responses
  • Configurable timeouts and concurrency limits

API Endpoints

1. Resize Images

POST /v1/resize[?async=true]

Query Parameters:

  • async: (optional) When true, processes images asynchronously

Request:

{
  "urls": [
    "https://example.com/image1.jpg",
    "https://example.com/image2.jpg"
  ],
  "width": 200,
  "height": 0  
}

Response:

[{
  "result": "success",
  "url": "http://localhost:8080/v1/image/abc123.jpeg",
  "cached": false
}]

2. Get Image

GET /v1/image/{id}.jpeg

Architecture

  • Cache: LRU cache with configurable size
  • Concurrency: Worker pool pattern
  • Basic Error Handling: Returns error responses for failed operations

Development

# Build
make build

# Run tests
make test

# Start server
make run

Dependencies

  • Go 1.20+
  • Go modules for dependency management

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published