增加管理后台

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

@@ -2,32 +2,10 @@ package sessdata
import (
"context"
"fmt"
"time"
"github.com/bjdgyc/anylink/common"
"golang.org/x/time/rate"
)
var Sess = &ConnSession{}
func init() {
return
tick := time.Tick(time.Second * 2)
go func() {
for range tick {
uP := common.HumanByte(float64(Sess.BandwidthUpPeriod / BandwidthPeriodSec))
dP := common.HumanByte(float64(Sess.BandwidthDownPeriod / BandwidthPeriodSec))
uA := common.HumanByte(float64(Sess.BandwidthUpAll))
dA := common.HumanByte(float64(Sess.BandwidthDownAll))
fmt.Printf("rateUp:%s rateDown:%s allUp %s allDown %s \n",
uP, dP, uA, dA)
}
}()
}
type LimitRater struct {
limit *rate.Limiter
}