Giter Club home page Giter Club logo

tics's Introduction

Go Report Card

TICS - Thumbnail Image Caching Service

A proof of concept implementation of a clean-architecture (see uncle bob's clean architecture description) with an image caching service as the main use-case.

  • The domain is the thumbnail.
  • The usecase is the image resizing and storing part.
  • The interface of the system is a webservice and storage abstraction.
  • The infrastructure implements the concrete resizer, storage etc systems.

how to run

install the dependencies, build the binary and start it

$ dep ensure
$ go build
$ ./tics 

To set the port, export the environment variable "TICS_PORT"

$ export TICS_PORT="8888"
$ ./tics # will start listening on port 8888

how to use

The tics service is using a base64 encoded url including width and height resizing information:

should be converted into the following pattern:<url>?w=<width>&h=<height>. Finally run all this through a base64 encoder and you are good to go:

Now you have a nice base64 encoded image path and some resizing information. Call the service with

  • localhost:8080/?i=<base64encoded...>
  • localhost:8080/?i=aHR0cHM6Ly93d3cud2lraXBlZGlhLm9yZy9wb3J0YWwvd2lraXBlZGlhLm9yZy9hc3NldHMvaW1nL1dpa2lwZWRpYS1sb2dvLXYyLnBuZz93PTIwJmg9MjA=

and you get a nice small wikipedia image.

run tests

cd /path/to/tics and then go test ./....

License

This project is licensed under MIT license. Use at your own risk and will!

tics's People

Contributors

co0p avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.