MCPcopy Create free account
hub / github.com/bytebase/bytebase / metadataText

Function metadataText

backend/plugin/webhook/googlechat/googlechat.go:148–163  ·  view source on GitHub ↗
(ctx webhook.Context)

Source from the content-addressed store, hash-verified

146}
147
148func metadataText(ctx webhook.Context) string {
149 parts := []string{}
150 if ctx.Project != nil && ctx.Project.Title != "" {
151 parts = append(parts, fmt.Sprintf("<b>Project:</b> %s", escapeText(ctx.Project.Title)))
152 }
153 if ctx.Issue != nil && ctx.Issue.Creator.Name != "" {
154 parts = append(parts, fmt.Sprintf("<b>Creator:</b> %s", escapeText(ctx.Issue.Creator.Name)))
155 }
156 if ctx.Environment != "" {
157 parts = append(parts, fmt.Sprintf("<b>Environment:</b> %s", escapeText(ctx.Environment)))
158 }
159 if ctx.ActorName != "" {
160 parts = append(parts, fmt.Sprintf("<b>By:</b> %s", escapeText(ctx.ActorName)))
161 }
162 return strings.Join(parts, "<br>")
163}
164
165func textWidget(text string) Widget {
166 return textWidgetHTML(escapeText(text))

Callers 1

BuildMessageFunction · 0.85

Calls 2

escapeTextFunction · 0.85
JoinMethod · 0.80

Tested by

no test coverage detected