A simple link shortener with support for several storage backends
Works out of the box with no external database or configuration however configuring it is extremely beneficial
- vedis - A networkless redis, similar to sqlite
- redis - Traditional redis
- mongo - You guessed it, mongo
- boltdb - boltdb :D
- go get github.com/freman/shortie
- rm ./bin/shortie
- go get github.com/GeertJohan/go.rice/rice
- ./bin/rice --import-path=github.com/freman/shortie embed-go
- go install github.com/freman/shortie
That's it, the shortie
binary in bin directory is now 100% self contained and ready to roll
Configuration is stored in a TOML file, out of the box it stores data with vedis in memory.
There are example configuration files in the example directory but the basic gist is.
listen = "listen configuration"
storage = "{drivername}"
[config.{drivername}]
$options for driver
- I've never actually used the mongo driver ;)
- I googled the image used as a backdrop, it was all over the place with no attribution, if it's yours, let me know if you want me to remove it or credit you.
- Needs a refactor for some real structure
- Filters can cause lockup if they're porly defined or written