Fix #261 add variable HTTP_CONTROL_SERVER_PORT
This commit is contained in:
@@ -110,6 +110,9 @@ type Reader interface {
|
||||
// Public IP getters
|
||||
GetPublicIPPeriod() (period time.Duration, err error)
|
||||
|
||||
// Control server
|
||||
GetControlServerPort() (port uint16, err error)
|
||||
|
||||
GetVersionInformation() (enabled bool, err error)
|
||||
|
||||
GetUpdaterPeriod() (period time.Duration, err error)
|
||||
|
||||
13
internal/params/server.go
Normal file
13
internal/params/server.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package params
|
||||
|
||||
import (
|
||||
libparams "github.com/qdm12/golibs/params"
|
||||
)
|
||||
|
||||
func (r *reader) GetControlServerPort() (port uint16, err error) {
|
||||
n, err := r.envParams.GetEnvIntRange("HTTP_CONTROL_SERVER_PORT", 1, 65535, libparams.Default("8000"))
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return uint16(n), nil
|
||||
}
|
||||
Reference in New Issue
Block a user