[DOC] typos

This commit is contained in:
Martin Geno 2017-06-13 00:39:12 +02:00
parent 5736ff3d97
commit bda7df2362
No known key found for this signature in database
GPG Key ID: F0D39A37E925E941
4 changed files with 14 additions and 15 deletions

View File

@ -1,5 +1,5 @@
// reciever of log entry over network (websocket)
package recieve
// receiver of log entry over network (websocket)
package receive
import (
"encoding/json"
@ -38,21 +38,21 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
var maybeToken string
msgType, msg, err := c.ReadMessage()
if err != nil {
logEntry.Error("recieving token", err)
logEntry.Error("receiving token", err)
break
}
if msgType != websocket.TextMessage {
logEntry.Warn("recieve no token")
logEntry.Warn("receive no token")
break
}
maybeToken = string(msg)
logEntry.AddField("token", maybeToken)
if !database.IsTokenValid(maybeToken) {
logEntry.Warn("recieve wrong token")
logEntry.Warn("receive wrong token")
break
} else {
token = maybeToken
logEntry.Info("recieve valid token")
logEntry.Info("receive valid token")
}
continue
}
@ -64,7 +64,7 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
break
}
if err != nil {
logEntry.Error("recieving log entry:", err)
logEntry.Error("receiving log entry:", err)
break
}
err = json.Unmarshal(msg, &entry)

View File

@ -1 +1 @@
package recieve
package receive

View File

@ -15,7 +15,7 @@ import (
"os/signal"
"syscall"
"github.com/genofire/logmania/api/recieve"
"github.com/genofire/logmania/api/receive"
"github.com/genofire/logmania/database"
"github.com/genofire/logmania/lib"
"github.com/genofire/logmania/log"
@ -53,7 +53,7 @@ func main() {
api = &lib.HTTPServer{
Addr: config.API.Bind,
Handler: recieve.NewHandler(),
Handler: receive.NewHandler(),
}
api.Start()

View File

@ -35,6 +35,5 @@ func (l *SelfLogger) Hook(e *log.Entry) {
database.InsertEntry("", e)
}
func (l *SelfLogger) Close() {
}