just a fmt

This commit is contained in:
skedar46
2018-05-17 19:55:13 -07:00
parent 190986d413
commit 3ca4e0800c
11 changed files with 16 additions and 16 deletions

View File

@@ -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"
)

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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()
)

View File

@@ -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"

View File

@@ -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"
)

View File

@@ -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"
)

2
rng.go
View File

@@ -1,6 +1,6 @@
package ss
import(
import (
"math/rand"
"sync"
"time"

View File

@@ -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)
}