Rename Config.GetServerPort() to HttpServerPort, see #50
This commit is contained in:
parent
cfd70b13f5
commit
f0c947ddfb
5 changed files with 15 additions and 11 deletions
|
@ -41,7 +41,7 @@ var startFlags = []cli.Flag{
|
|||
func startAction(ctx *cli.Context) error {
|
||||
conf := context.NewConfig(ctx)
|
||||
|
||||
if conf.GetServerPort() < 1 {
|
||||
if conf.HttpServerPort() < 1 {
|
||||
log.Fatal("Server port must be a positive integer")
|
||||
}
|
||||
|
||||
|
|
|
@ -331,13 +331,13 @@ func (c *Config) SqlServerPort() uint {
|
|||
return c.sqlServerPort
|
||||
}
|
||||
|
||||
// HttpServerHost returns the server host name or IP address (empty for all interfaces).
|
||||
// HttpServerHost returns the built-in HTTP server host name or IP address (empty for all interfaces).
|
||||
func (c *Config) HttpServerHost() string {
|
||||
return c.httpServerHost
|
||||
}
|
||||
|
||||
// GetServerPort returns the server port.
|
||||
func (c *Config) GetServerPort() int {
|
||||
// HttpServerPort returns the built-in HTTP server port.
|
||||
func (c *Config) HttpServerPort() int {
|
||||
return c.httpServerPort
|
||||
}
|
||||
|
||||
|
|
|
@ -9,21 +9,25 @@ import (
|
|||
|
||||
// Todo: Remove Get prefix, see https://golang.org/doc/effective_go.html#Getters
|
||||
type Config interface {
|
||||
Debug() bool
|
||||
Db() *gorm.DB
|
||||
|
||||
CreateDirectories() error
|
||||
MigrateDb()
|
||||
|
||||
Db() *gorm.DB
|
||||
ClientConfig() frontend.Config
|
||||
|
||||
ConfigFile() string
|
||||
|
||||
AppName() string
|
||||
AppVersion() string
|
||||
AppCopyright() string
|
||||
Debug() bool
|
||||
|
||||
SqlServerHost() string
|
||||
SqlServerPort() uint
|
||||
|
||||
HttpServerHost() string
|
||||
GetServerPort() int
|
||||
HttpServerPort() int
|
||||
|
||||
GetServerMode() string
|
||||
GetDatabaseDriver() string
|
||||
GetDatabaseDsn() string
|
||||
|
|
|
@ -22,5 +22,5 @@ func Start(conf photoprism.Config) {
|
|||
|
||||
registerRoutes(app, conf)
|
||||
|
||||
app.Run(fmt.Sprintf("%s:%d", conf.HttpServerHost(), conf.GetServerPort()))
|
||||
app.Run(fmt.Sprintf("%s:%d", conf.HttpServerHost(), conf.HttpServerPort()))
|
||||
}
|
||||
|
|
|
@ -183,8 +183,8 @@ func (c *Config) HttpServerHost() string {
|
|||
return "127.0.0.1"
|
||||
}
|
||||
|
||||
// GetServerPort returns the server port.
|
||||
func (c *Config) GetServerPort() int {
|
||||
// HttpServerPort returns the server port.
|
||||
func (c *Config) HttpServerPort() int {
|
||||
return 80
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue