A simple Go application which contains the following features:
- Acts as an HTTP client
- Acts as an HTTP server
- Makes use of Redis for caching
- The application exposes a web server that receives a querystring
q
as its only argument. - The string provided for
q
will be used to query Google. - The results from the first page are then filtered and all titles of results are returned in a JSON format.
- The result is then cached in Redis for 15 seconds.
- If the same query is made within 15 seconds, the data is retrieved from Redis instead of querying Google again.
$ docker compose up -d
$ go run .
- Call the URL http://localhost:9090/query?q=myquery