Update Phoenix namespace flag (#21)

Update Phoenix namespace flag
This commit is contained in:
Alex Unger
2019-12-24 11:56:37 +01:00
committed by GitHub
3 changed files with 12 additions and 12 deletions

View File

@@ -135,7 +135,7 @@ func Server(cfg *config.Config) cli.Command {
server, err := http.Server(
http.Logger(logger),
http.Context(ctx),
http.Namespace(cfg.Phoenix.Namespace),
http.Namespace(cfg.HTTP.Namespace),
http.Config(cfg),
http.Metrics(metrics),
http.Flags(flagset.RootWithConfig(cfg)),

View File

@@ -17,8 +17,9 @@ type Debug struct {
// HTTP defines the available http configuration.
type HTTP struct {
Addr string
Root string
Addr string
Root string
Namespace string
}
// Tracing defines the available tracing configuration.
@@ -37,8 +38,7 @@ type Asset struct {
// Phoenix defines the available phoenic configuration.
type Phoenix struct {
Path string
Namespace string
Path string
}
// Config combines all available configuration parts.

View File

@@ -127,6 +127,13 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag {
EnvVar: "PHOENIX_HTTP_ROOT",
Destination: &cfg.HTTP.Root,
},
&cli.StringFlag{
Name: "http-namespace",
Value: "com.owncloud.web",
Usage: "Set the base namespace for the http namespace",
EnvVar: "PHOENIX_NAMESPACE",
Destination: &cfg.HTTP.Namespace,
},
&cli.StringFlag{
Name: "asset-path",
Value: "",
@@ -141,12 +148,5 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag {
EnvVar: "PHOENIX_WEB_CONFIG",
Destination: &cfg.Phoenix.Path,
},
&cli.StringFlag{
Name: "http-namespace",
Value: "com.owncloud.web",
Usage: "Set the base namespace for the http namespace",
EnvVar: "PHOENIX_NAMESPACE",
Destination: &cfg.Phoenix.Namespace,
},
}
}