Go + Redis app that allows to get and cache information via an API
Current stable version: 0.1.3
- go dep - Used to manage 3rd party libs dependencies
- github.com/garyburd/redigo - Redis lib, used to comunicate with redis
- github.com/ghodss/yaml - Yaml file reader lib, used to reaad the configuration file
This project uses the Makefile to manage this project lifecycle
- Install the go dep
go get -u github.com/golang/dep/cmd/dep
- Use
make dependecies
to download the libraries the project uses - Use
make test
to run the app tests the - Use
make install
to generate the go executable file
- Configure your
$GOPATH
to your go workspace is; - Execute the
make dependencies
command to dowload the project dependencies to your go workspace; - Execute the
make install
command to generate the app executable - Start a Redis server
- Configure the local.yaml setting the redis client properties.
- Run the executable generated at the step 3
Resource | Method | Description |
---|---|---|
/save | (POST) | Save all parameters that is sent at the redis storage. |
/retrieve | (GET) | Get all the registers that the server has (Sorry it uses KEYS redis command, dont use it in production) |
/retrieve?query | (GET) | Get registers that matches the pattern (Sorry it uses KEYS redis command, dont use it in production) |
/save (POST)
{
"aa" : "a",
"ab" : "b",
"CC" : "c",
"cD" : "d"
}
The project uses the default go lang logger. If you want log rotation, you can use the default linux logrotate to do this.
In case of any doubt, mail me: [email protected] =)