Rename Config.GetServerPort() to HttpServerPort, see #50

This commit is contained in:
Michael Mayer 2018-12-21 03:16:50 +01:00
parent cfd70b13f5
commit f0c947ddfb
5 changed files with 15 additions and 11 deletions

View file

@ -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")
}

View file

@ -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
}

View file

@ -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

View file

@ -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()))
}

View file

@ -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
}