From 3ca4e0800ca7785853818577db4c9054bfbaa3a0 Mon Sep 17 00:00:00 2001 From: skedar46 Date: Thu, 17 May 2018 19:55:13 -0700 Subject: [PATCH] just a fmt --- backend/ssdummy/ssdummy.go | 2 +- backend/ssgrpc/cred.go | 2 +- backend/ssgrpc/server.go | 2 +- backend/ssgrpc/ssgrpc.go | 2 +- backend/ssmongo/ssmongo.go | 2 +- backend/ssredis/ssredis.go | 8 ++++---- examples/not-so-simple-examples/grpc-multihome/main.go | 2 +- examples/not-so-simple-examples/redis-multihome/main.go | 2 +- examples/simple-examples/chat/main.go | 2 +- rng.go | 2 +- server.go | 6 +++--- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/backend/ssdummy/ssdummy.go b/backend/ssdummy/ssdummy.go index 29d8fac..edcbdc0 100644 --- a/backend/ssdummy/ssdummy.go +++ b/backend/ssdummy/ssdummy.go @@ -2,8 +2,8 @@ package ssdummy import ( - ss "github.com/raz-varren/sacrificial-socket" "github.com/raz-varren/log" + ss "github.com/raz-varren/sacrificial-socket" "time" ) diff --git a/backend/ssgrpc/cred.go b/backend/ssgrpc/cred.go index 6ddb6dd..721ad29 100644 --- a/backend/ssgrpc/cred.go +++ b/backend/ssgrpc/cred.go @@ -1,8 +1,8 @@ package ssgrpc import ( - "github.com/raz-varren/sacrificial-socket/backend/ssgrpc/token" "github.com/raz-varren/log" + "github.com/raz-varren/sacrificial-socket/backend/ssgrpc/token" "golang.org/x/net/context" "sync" "time" diff --git a/backend/ssgrpc/server.go b/backend/ssgrpc/server.go index 170e0e3..421c3bb 100644 --- a/backend/ssgrpc/server.go +++ b/backend/ssgrpc/server.go @@ -3,10 +3,10 @@ package ssgrpc import ( "encoding/json" "errors" + "github.com/raz-varren/log" ss "github.com/raz-varren/sacrificial-socket" "github.com/raz-varren/sacrificial-socket/backend/ssgrpc/token" "github.com/raz-varren/sacrificial-socket/backend/ssgrpc/transport" - "github.com/raz-varren/log" "golang.org/x/net/context" "google.golang.org/grpc/metadata" "strings" diff --git a/backend/ssgrpc/ssgrpc.go b/backend/ssgrpc/ssgrpc.go index 54e8b93..d08581e 100644 --- a/backend/ssgrpc/ssgrpc.go +++ b/backend/ssgrpc/ssgrpc.go @@ -5,9 +5,9 @@ package ssgrpc import ( "encoding/json" + "github.com/raz-varren/log" ss "github.com/raz-varren/sacrificial-socket" "github.com/raz-varren/sacrificial-socket/backend/ssgrpc/transport" - "github.com/raz-varren/log" "golang.org/x/net/context" "google.golang.org/grpc" "google.golang.org/grpc/credentials" diff --git a/backend/ssmongo/ssmongo.go b/backend/ssmongo/ssmongo.go index 596ea63..9851413 100644 --- a/backend/ssmongo/ssmongo.go +++ b/backend/ssmongo/ssmongo.go @@ -5,8 +5,8 @@ package ssmongo import ( "encoding/json" - ss "github.com/raz-varren/sacrificial-socket" "github.com/raz-varren/log" + ss "github.com/raz-varren/sacrificial-socket" "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" "io" diff --git a/backend/ssredis/ssredis.go b/backend/ssredis/ssredis.go index 9b8d696..d033ff7 100644 --- a/backend/ssredis/ssredis.go +++ b/backend/ssredis/ssredis.go @@ -4,13 +4,13 @@ Package ssredis provides a ss.MultihomeBackend interface that uses Redis for syn package ssredis import ( - "github.com/go-redis/redis" - ss "github.com/raz-varren/sacrificial-socket" - "github.com/raz-varren/log" "encoding/hex" + "github.com/go-redis/redis" + "github.com/raz-varren/log" + ss "github.com/raz-varren/sacrificial-socket" ) -var( +var ( rng = ss.NewRNG() ) diff --git a/examples/not-so-simple-examples/grpc-multihome/main.go b/examples/not-so-simple-examples/grpc-multihome/main.go index ea98761..5010469 100644 --- a/examples/not-so-simple-examples/grpc-multihome/main.go +++ b/examples/not-so-simple-examples/grpc-multihome/main.go @@ -6,9 +6,9 @@ package main import ( "encoding/json" "flag" + "github.com/raz-varren/log" "github.com/raz-varren/sacrificial-socket" "github.com/raz-varren/sacrificial-socket/backend/ssgrpc" - "github.com/raz-varren/log" "net/http" "os" "strings" diff --git a/examples/not-so-simple-examples/redis-multihome/main.go b/examples/not-so-simple-examples/redis-multihome/main.go index cd2e287..fc1280a 100644 --- a/examples/not-so-simple-examples/redis-multihome/main.go +++ b/examples/not-so-simple-examples/redis-multihome/main.go @@ -7,9 +7,9 @@ import ( "encoding/json" "flag" "github.com/go-redis/redis" + "github.com/raz-varren/log" "github.com/raz-varren/sacrificial-socket" "github.com/raz-varren/sacrificial-socket/backend/ssredis" - "github.com/raz-varren/log" "net/http" "os" ) diff --git a/examples/simple-examples/chat/main.go b/examples/simple-examples/chat/main.go index ac2faf5..f41067a 100644 --- a/examples/simple-examples/chat/main.go +++ b/examples/simple-examples/chat/main.go @@ -5,8 +5,8 @@ package main import ( "encoding/json" - ss "github.com/raz-varren/sacrificial-socket" "github.com/raz-varren/log" + ss "github.com/raz-varren/sacrificial-socket" "net/http" ) diff --git a/rng.go b/rng.go index e25c2c4..6e48c3d 100644 --- a/rng.go +++ b/rng.go @@ -1,6 +1,6 @@ package ss -import( +import ( "math/rand" "sync" "time" diff --git a/server.go b/server.go index bdd6300..85ee451 100644 --- a/server.go +++ b/server.go @@ -97,7 +97,7 @@ func (serv *SocketServer) Shutdown() bool { } //EventHandler is an interface for registering events using SockerServer.OnEvent -type EventHandler interface{ +type EventHandler interface { HandleEvent(*Socket, []byte) EventName() string } @@ -111,9 +111,9 @@ func (serv *SocketServer) On(eventName string, handleFunc func(*Socket, []byte)) serv.events[eventName] = &event{eventName, handleFunc} //you think you can handle the func? } -//OnEvent has the same functionality as On, but accepts +//OnEvent has the same functionality as On, but accepts //an EventHandler interface instead of a handler function. -func (serv *SocketServer) OnEvent(h EventHandler){ +func (serv *SocketServer) OnEvent(h EventHandler) { serv.On(h.EventName(), h.HandleEvent) }