defaults dont work for conf

This commit is contained in:
Bel LaPointe
2019-02-23 18:54:33 -07:00
parent 73de851e81
commit 2099ae50c6
5 changed files with 66 additions and 3 deletions

View File

@@ -3,12 +3,16 @@ package server
import (
"local/rproxy3/config"
"local/rproxy3/storage"
"golang.org/x/time/rate"
)
func New() *Server {
port := config.GetPort()
r, b := config.GetRate()
return &Server{
db: storage.NewMap(),
addr: port,
db: storage.NewMap(),
addr: port,
limiter: rate.NewLimiter(rate.Limit(r), b),
}
}