management server listener (#17)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

Reviewed-on: #17
Co-authored-by: David Ashby <delta.mu.alpha@gmail.com>
Co-committed-by: David Ashby <delta.mu.alpha@gmail.com>
This commit is contained in:
2024-01-06 21:38:13 +00:00
committed by David
parent dc7218131d
commit 315fb4e9d2
19 changed files with 1112 additions and 224 deletions

28
query/funcs.go Normal file
View File

@@ -0,0 +1,28 @@
package query
import (
"fmt"
"strings"
)
func tryGetFirst(s []string) string {
if len(s) == 0 {
return ""
}
return s[0]
}
func buildTitle(title, subtitle string) string {
if subtitle != "" {
return fmt.Sprintf("%s: %s", title, subtitle)
}
return title
}
func getLastName(author string) string {
names := strings.Split(author, " ")
if len(names) < 2 {
return author
}
return names[len(names)-1]
}