Skip to content
Snippets Groups Projects
Commit 47a0379860f0 authored by Christophe de Vienne's avatar Christophe de Vienne
Browse files

Add a CustomInfo so the application can add its own global flags

parent 714427040ae3
No related branches found
No related tags found
No related merge requests found
Pipeline #13437 passed
...@@ -60,7 +60,12 @@ ...@@ -60,7 +60,12 @@
- name: cmdServeConfig - name: cmdServeConfig
source: server/cmdServeConfig.gotmpl source: server/cmdServeConfig.gotmpl
target: "{{ joinFilePath .Target \"cmd\" (dasherize (pascalize .Name)) }}/cmd" target: "{{ joinFilePath .Target \"cmd\" (dasherize (pascalize .Name)) }}/cmd"
file_name: serve-config.go file_name: serve_config.go
skip_exists: true
- name: cmdCustomInfo
source: server/cmdCustomInfo.gotmpl
target: "{{ joinFilePath .Target \"cmd\" (dasherize (pascalize .Name)) }}/cmd"
file_name: custom_info.go
skip_exists: true skip_exists: true
- name: configure - name: configure
source: server/configureapi.gotmpl source: server/configureapi.gotmpl
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
type Info struct { type Info struct {
Environment string `long:"environment" env:"ENVIRONMENT" ini-name:"environment" default:"default" description:"A environment name, used in sentry and prometheus"` Environment string `long:"environment" env:"ENVIRONMENT" ini-name:"environment" default:"default" description:"A environment name, used in sentry and prometheus"`
CustomInfo
} }
var ( var (
......
// This file is generated only once and is safe to edit
package cmd
type CustomInfo struct {
// Custom global flags can be added here. For example:
// BaseURL string `long:"base-url" env:"BASE_URL" ini-name:"base-url" description:"The public facing base URL of the API. Used to forge URLs"`
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment