add gateway
This commit is contained in:
10
conf/new.go
10
conf/new.go
@@ -59,17 +59,17 @@ func NotNil(values ...string) {
|
||||
}
|
||||
}
|
||||
|
||||
func PrintInfo(ip string, port int) {
|
||||
func PrintInfo(addr string) {
|
||||
print.Success("[BSM - %s] Config Check Success.", vars.ServiceKey)
|
||||
print.Info("[BSM - %s] Service Name: %s", vars.ServiceKey, vars.ServiceKey)
|
||||
print.Info("[BSM - %s] Runtime Mode: %s", vars.ServiceKey, env.Runtime.Mode)
|
||||
print.Info("[BSM - %s] Listen Addr: %s:%d", vars.ServiceKey, ip, port)
|
||||
}
|
||||
|
||||
func CheckPort(port int) int {
|
||||
if port <= 0 || port >= 65535 {
|
||||
func CheckPort(port string) string {
|
||||
if port == "" {
|
||||
r := rand.New(rand.NewPCG(1000, uint64(time.Now().UnixNano())))
|
||||
return r.IntN(65535-1024) + 1024 // 生成1024到65535之间的随机端口
|
||||
p := r.IntN(65535-1024) + 1024 // 生成1024到65535之间的随机端口
|
||||
return utils.Int2String(p)
|
||||
}
|
||||
return port
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user