resizer

command module
v0.0.0-...-b332784 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 29, 2016 License: MIT Imports: 11 Imported by: 0

README

resizer Build Status

This is a naive approach to build an image resizing service. At the moment given few parameters the system returns the image resized.

At the moment this service supports those versions of Go:

  • 1.3
  • 1.4
  • latest stable version
How it works?

By now it listen automatically to port 8080 by default (this should be changed in the near future).

Resizing endpoint:

GET host:8080/resize

Parameters:

  • image: Current image url you want to change
  • width: New width of the image
  • height: New image height
Configuration

By default we provide a dummy config.json file with some useless default values. In this configuration you can do:

  • Configure default port to listen
  • List of white hosts allowed to resize the image
  • Max height and width for the new image

About the hosts by default all of them are restricted. But you can add as many hosts as you want and you can use regular expressions!

For example you can do something like this:

{
    "hostwhitelist": [
        "([a-z]+).supercdn.com"
    ]
}

The previous example show you how to allow any something.supercdn.com host.

Dependencies

This service relies on top of some greate packages like:

TODO
  • Resize a given image with width/height parameters
  • Create some unit tests
  • Gopher even more this code
  • Configure server with configuration files
  • Move validators to another Go file
  • Allow to find hosts by regex patterns

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL