From 43f588b5c1701f645e0ebe084942b39bdd0cb118 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dobros=C5=82aw=20=C5=BBybort?= Date: Thu, 20 Jun 2013 15:25:39 +0300 Subject: [PATCH] Fix: session README --- session/README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/session/README.md b/session/README.md index e5a366e3..226359de 100644 --- a/session/README.md +++ b/session/README.md @@ -32,14 +32,6 @@ Then in you web app init the global session manager go globalSessions.GC() } -* Use **MySQL** as provider, the last param is the DNS, learn more from [mysql](https://github.com/Go-SQL-Driver/MySQL#dsn-data-source-name): - - func init() { - globalSessions, _ = session.NewManager( - "mysql", "gosessionid", 3600, "username:password@protocol(address)/dbname?param=value") - go globalSessions.GC() - } - * Use **file** as provider, the last param is the path where you want file to be stored: func init() { @@ -53,6 +45,14 @@ Then in you web app init the global session manager globalSessions, _ = session.NewManager("redis", "gosessionid", 3600, "127.0.0.1:6379") go globalSessions.GC() } + +* Use **MySQL** as provider, the last param is the DSN, learn more from [mysql](https://github.com/Go-SQL-Driver/MySQL#dsn-data-source-name): + + func init() { + globalSessions, _ = session.NewManager( + "mysql", "gosessionid", 3600, "username:password@protocol(address)/dbname?param=value") + go globalSessions.GC() + } Finally in the handlerfunc you can use it like this