Skip to content

Commit

Permalink
Add doc_references field to servicelogs
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexVulaj committed Feb 8, 2024
1 parent c163a14 commit bee1165
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions internal/servicelog/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ import (

// Message is the base template structure
type Message struct {
Severity string `json:"severity"`
ServiceName string `json:"service_name"`
ClusterUUID string `json:"cluster_uuid,omitempty"`
ClusterID string `json:"cluster_id,omitempty"`
Summary string `json:"summary"`
Description string `json:"description"`
InternalOnly bool `json:"internal_only"`
EventStreamID string `json:"event_stream_id"`
SubscriptionID string `json:"subscription_id,omitempty"`
Severity string `json:"severity"`
ServiceName string `json:"service_name"`
ClusterUUID string `json:"cluster_uuid,omitempty"`
ClusterID string `json:"cluster_id,omitempty"`
Summary string `json:"summary"`
Description string `json:"description"`
InternalOnly bool `json:"internal_only"`
EventStreamID string `json:"event_stream_id"`
SubscriptionID string `json:"subscription_id,omitempty"`
DocReferences []string `json:"doc_references"`
}

func (m *Message) GetSeverity() string {
Expand Down Expand Up @@ -54,6 +55,10 @@ func (m *Message) GetSubscriptionID() string {
return m.SubscriptionID
}

func (m *Message) GetDocReferences() []string {
return m.DocReferences
}

func (m *Message) ReplaceWithFlag(variable, value string) {
m.Severity = strings.ReplaceAll(m.Severity, variable, value)
m.ServiceName = strings.ReplaceAll(m.ServiceName, variable, value)
Expand Down

0 comments on commit bee1165

Please sign in to comment.