增加管理后台

This commit is contained in:
bjd
2020-12-16 16:36:56 +08:00
parent 31b1f12dbe
commit a9584000c6
68 changed files with 2408 additions and 1281 deletions

View File

@@ -1,7 +1,6 @@
package sessdata
import (
"sync"
"testing"
"github.com/stretchr/testify/assert"
@@ -9,10 +8,10 @@ import (
func TestNewSession(t *testing.T) {
assert := assert.New(t)
sessions = sync.Map{}
sess := NewSession()
sessions = make(map[string]*Session)
sess := NewSession("")
token := sess.Token
v, ok := sessions.Load(token)
v, ok := sessions[token]
assert.True(ok)
assert.Equal(sess, v)
}
@@ -21,7 +20,7 @@ func TestConnSession(t *testing.T) {
assert := assert.New(t)
preIpData()
defer closeIpdata()
sess := NewSession()
sess := NewSession("")
cSess := sess.NewConn()
cSess.RateLimit(100, true)
assert.Equal(cSess.BandwidthUp, uint32(100))