remove all "omitempty" from config structs to bring back full configuration file documentation

This commit is contained in:
Willy Kloucek
2022-04-28 15:08:40 +02:00
parent aba2ee0c39
commit ab254b05d0
31 changed files with 802 additions and 802 deletions
+22 -22
View File
@@ -12,15 +12,15 @@ type Config struct {
Service Service `yaml:"-"`
Tracing *Tracing `yaml:"tracing,omitempty"`
Log *Log `yaml:"log,omitempty"`
Debug Debug `yaml:"debug,omitempty"`
Tracing *Tracing `yaml:"tracing"`
Log *Log `yaml:"log"`
Debug Debug `yaml:"debug"`
HTTP HTTP `yaml:"http,omitempty"`
HTTP HTTP `yaml:"http"`
Asset Asset `yaml:"asset,omitempty"`
File string `yaml:"file,omitempty" env:"WEB_UI_CONFIG"` // TODO: rename this to a more self explaining string
Web Web `yaml:"web,omitempty"`
Asset Asset `yaml:"asset"`
File string `yaml:"file" env:"WEB_UI_CONFIG"` // TODO: rename this to a more self explaining string
Web Web `yaml:"web"`
Context context.Context `yaml:"-"`
}
@@ -32,22 +32,22 @@ type Asset struct {
// WebConfig defines the available web configuration for a dynamically rendered config.json.
type WebConfig struct {
Server string `json:"server,omitempty" yaml:"server" env:"OCIS_URL;WEB_UI_CONFIG_SERVER"`
Theme string `json:"theme,omitempty" yaml:"theme" env:""`
Version string `json:"version,omitempty" yaml:"version" env:"WEB_UI_CONFIG_VERSION"`
OpenIDConnect OIDC `json:"openIdConnect,omitempty" yaml:"oids"`
Server string `json:"server" yaml:"server" env:"OCIS_URL;WEB_UI_CONFIG_SERVER"`
Theme string `json:"theme" yaml:"theme" env:""`
Version string `json:"version" yaml:"version" env:"WEB_UI_CONFIG_VERSION"`
OpenIDConnect OIDC `json:"openIdConnect" yaml:"oids"`
Apps []string `json:"apps" yaml:"apps"`
ExternalApps []ExternalApp `json:"external_apps,omitempty" yaml:"external_apps"`
Options map[string]interface{} `json:"options,omitempty" yaml:"options"`
ExternalApps []ExternalApp `json:"external_apps" yaml:"external_apps"`
Options map[string]interface{} `json:"options" yaml:"options"`
}
// OIDC defines the available oidc configuration
type OIDC struct {
MetadataURL string `json:"metadata_url,omitempty" yaml:"metadata_url" env:"WEB_OIDC_METADATA_URL"`
Authority string `json:"authority,omitempty" yaml:"authority" env:"OCIS_URL;WEB_OIDC_AUTHORITY"`
ClientID string `json:"client_id,omitempty" yaml:"client_id" env:"WEB_OIDC_CLIENT_ID"`
ResponseType string `json:"response_type,omitempty" yaml:"response_type" env:"WEB_OIDC_RESPONSE_TYPE"`
Scope string `json:"scope,omitempty" yaml:"scope" env:"WEB_OIDC_SCOPE"`
MetadataURL string `json:"metadata_url" yaml:"metadata_url" env:"WEB_OIDC_METADATA_URL"`
Authority string `json:"authority" yaml:"authority" env:"OCIS_URL;WEB_OIDC_AUTHORITY"`
ClientID string `json:"client_id" yaml:"client_id" env:"WEB_OIDC_CLIENT_ID"`
ResponseType string `json:"response_type" yaml:"response_type" env:"WEB_OIDC_RESPONSE_TYPE"`
Scope string `json:"scope" yaml:"scope" env:"WEB_OIDC_SCOPE"`
}
// ExternalApp defines an external web app.
@@ -59,15 +59,15 @@ type OIDC struct {
// }
// }
type ExternalApp struct {
ID string `json:"id,omitempty" yaml:"id"`
Path string `json:"path,omitempty" yaml:"path"`
ID string `json:"id" yaml:"id"`
Path string `json:"path" yaml:"path"`
// Config is completely dynamic, because it depends on the extension
Config map[string]interface{} `json:"config,omitempty" yaml:"config"`
Config map[string]interface{} `json:"config" yaml:"config"`
}
// ExternalAppConfig defines an external web app configuration.
type ExternalAppConfig struct {
URL string `json:"url,omitempty" yaml:"url" env:""`
URL string `json:"url" yaml:"url" env:""`
}
// Web defines the available web configuration.