1
0
mirror of https://github.com/bingohuang/docker-labs.git synced 2025-10-05 09:53:21 +08:00

Initial commit

This commit is contained in:
Jonathan Leibiusky (@xetorthio)
2016-10-08 03:12:48 +02:00
parent f2ae4344fd
commit dde49d8700
19 changed files with 5031 additions and 0 deletions

22
handlers/get_session.go Normal file
View File

@@ -0,0 +1,22 @@
package handlers
import (
"encoding/json"
"net/http"
"github.com/go-zoo/bone"
"github.com/xetorthio/play-with-docker/services"
)
func GetSession(rw http.ResponseWriter, req *http.Request) {
sessionId := bone.GetValue(req, "sessionId")
session := services.GetSession(sessionId)
if session == nil {
rw.WriteHeader(http.StatusNotFound)
return
}
json.NewEncoder(rw).Encode(session)
}