From 7c6d4262ee6f25692569ed32f72f7d8f6bb4ba3e Mon Sep 17 00:00:00 2001 From: abeltay Date: Tue, 12 Dec 2017 15:16:16 +0800 Subject: [PATCH] Improve documentation in README (#6) --- README.md | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index bc3183b..140ba0a 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,11 @@ # GoKit -Useful code for our Go projects +This repository contains useful code that we use in our Go projects. -`go get -u github.com/moexmen/gokit` +### Random +Random generates cryptographically random strings. This can be used to generate variables such as session IDs. -## Random -Cryptographically random strings to be used for things like session IDs. - -## Server -Starts a HTTP server with graceful shutdown when receiving `SIGINT` or `SIGTERM` +### Server +Server extends the default HTTP server with graceful shutdown on receiving `SIGINT` or `SIGTERM`. The web server is a 1 to 1 replacement of http.Server's `ListenAndServe()`. Example code: ``` @@ -27,5 +25,4 @@ func main() { log.Println(s.ListenAndServe()) } ``` - -[Docker Stop](https://docs.docker.com/compose/reference/stop/) has a default timeout of 10 seconds. We recommend to use a timeout lower than 10 seconds if you use Docker. +If you use docker, [docker stop](https://docs.docker.com/compose/reference/stop/) has a default timeout of 10 seconds, the graceful timeout should be set to expire before then.