diff options
Diffstat (limited to 'model')
-rw-r--r-- | model/config.go | 16 | ||||
-rw-r--r-- | model/license.go | 7 | ||||
-rw-r--r-- | model/websocket_message.go | 9 |
3 files changed, 32 insertions, 0 deletions
diff --git a/model/config.go b/model/config.go index f2ff788d8..40c76efe5 100644 --- a/model/config.go +++ b/model/config.go @@ -98,6 +98,11 @@ type ClusterSettings struct { InterNodeUrls []string } +type MetricsSettings struct { + Enable *bool + ListenAddress *string +} + type SSOSettings struct { Enable bool Secret string @@ -330,6 +335,7 @@ type Config struct { SamlSettings SamlSettings NativeAppSettings NativeAppSettings ClusterSettings ClusterSettings + MetricsSettings MetricsSettings WebrtcSettings WebrtcSettings } @@ -772,6 +778,16 @@ func (o *Config) SetDefaults() { o.ClusterSettings.InterNodeUrls = []string{} } + if o.MetricsSettings.ListenAddress == nil { + o.MetricsSettings.ListenAddress = new(string) + *o.MetricsSettings.ListenAddress = ":8067" + } + + if o.MetricsSettings.Enable == nil { + o.MetricsSettings.Enable = new(bool) + *o.MetricsSettings.Enable = false + } + if o.ComplianceSettings.Enable == nil { o.ComplianceSettings.Enable = new(bool) *o.ComplianceSettings.Enable = false diff --git a/model/license.go b/model/license.go index 8d8d0068f..7115aa1ac 100644 --- a/model/license.go +++ b/model/license.go @@ -39,6 +39,7 @@ type Features struct { Office365OAuth *bool `json:"office365_oauth"` Compliance *bool `json:"compliance"` Cluster *bool `json:"cluster"` + Metrics *bool `json:"metrics"` CustomBrand *bool `json:"custom_brand"` MHPNS *bool `json:"mhpns"` SAML *bool `json:"saml"` @@ -55,6 +56,7 @@ func (f *Features) ToMap() map[string]interface{} { "office365": *f.Office365OAuth, "compliance": *f.Compliance, "cluster": *f.Cluster, + "metrics": *f.Metrics, "custom_brand": *f.CustomBrand, "mhpns": *f.MHPNS, "saml": *f.SAML, @@ -104,6 +106,11 @@ func (f *Features) SetDefaults() { *f.Cluster = *f.FutureFeatures } + if f.Metrics == nil { + f.Metrics = new(bool) + *f.Metrics = *f.FutureFeatures + } + if f.CustomBrand == nil { f.CustomBrand = new(bool) *f.CustomBrand = *f.FutureFeatures diff --git a/model/websocket_message.go b/model/websocket_message.go index 5eb02642e..3fa58aeb3 100644 --- a/model/websocket_message.go +++ b/model/websocket_message.go @@ -34,6 +34,7 @@ type WebSocketMessage interface { IsValid() bool DoPreComputeJson() GetPreComputeJson() []byte + EventType() string } type WebsocketBroadcast struct { @@ -63,6 +64,10 @@ func (o *WebSocketEvent) IsValid() bool { return o.Event != "" } +func (o *WebSocketEvent) EventType() string { + return o.Event +} + func (o *WebSocketEvent) DoPreComputeJson() { b, err := json.Marshal(o) if err != nil { @@ -120,6 +125,10 @@ func (o *WebSocketResponse) IsValid() bool { return o.Status != "" } +func (o *WebSocketResponse) EventType() string { + return "" +} + func (o *WebSocketResponse) ToJson() string { b, err := json.Marshal(o) if err != nil { |