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 {
|
func startAction(ctx *cli.Context) error {
|
||||||
conf := context.NewConfig(ctx)
|
conf := context.NewConfig(ctx)
|
||||||
|
|
||||||
if conf.GetServerPort() < 1 {
|
if conf.HttpServerPort() < 1 {
|
||||||
log.Fatal("Server port must be a positive integer")
|
log.Fatal("Server port must be a positive integer")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -331,13 +331,13 @@ func (c *Config) SqlServerPort() uint {
|
||||||
return c.sqlServerPort
|
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 {
|
func (c *Config) HttpServerHost() string {
|
||||||
return c.httpServerHost
|
return c.httpServerHost
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetServerPort returns the server port.
|
// HttpServerPort returns the built-in HTTP server port.
|
||||||
func (c *Config) GetServerPort() int {
|
func (c *Config) HttpServerPort() int {
|
||||||
return c.httpServerPort
|
return c.httpServerPort
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,21 +9,25 @@ import (
|
||||||
|
|
||||||
// Todo: Remove Get prefix, see https://golang.org/doc/effective_go.html#Getters
|
// Todo: Remove Get prefix, see https://golang.org/doc/effective_go.html#Getters
|
||||||
type Config interface {
|
type Config interface {
|
||||||
|
Debug() bool
|
||||||
|
Db() *gorm.DB
|
||||||
|
|
||||||
CreateDirectories() error
|
CreateDirectories() error
|
||||||
MigrateDb()
|
MigrateDb()
|
||||||
|
|
||||||
Db() *gorm.DB
|
|
||||||
ClientConfig() frontend.Config
|
ClientConfig() frontend.Config
|
||||||
|
|
||||||
ConfigFile() string
|
ConfigFile() string
|
||||||
|
|
||||||
AppName() string
|
AppName() string
|
||||||
AppVersion() string
|
AppVersion() string
|
||||||
AppCopyright() string
|
AppCopyright() string
|
||||||
Debug() bool
|
|
||||||
SqlServerHost() string
|
SqlServerHost() string
|
||||||
SqlServerPort() uint
|
SqlServerPort() uint
|
||||||
|
|
||||||
HttpServerHost() string
|
HttpServerHost() string
|
||||||
GetServerPort() int
|
HttpServerPort() int
|
||||||
|
|
||||||
GetServerMode() string
|
GetServerMode() string
|
||||||
GetDatabaseDriver() string
|
GetDatabaseDriver() string
|
||||||
GetDatabaseDsn() string
|
GetDatabaseDsn() string
|
||||||
|
|
|
@ -22,5 +22,5 @@ func Start(conf photoprism.Config) {
|
||||||
|
|
||||||
registerRoutes(app, conf)
|
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"
|
return "127.0.0.1"
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetServerPort returns the server port.
|
// HttpServerPort returns the server port.
|
||||||
func (c *Config) GetServerPort() int {
|
func (c *Config) HttpServerPort() int {
|
||||||
return 80
|
return 80
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue