2024-08-02 21:48:26 +00:00
|
|
|
package model
|
|
|
|
|
|
|
|
import (
|
|
|
|
"regexp"
|
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Link struct {
|
2024-09-01 03:43:32 +00:00
|
|
|
Name string `json:"name"`
|
|
|
|
URL string `json:"url"`
|
2024-08-02 21:48:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (link Link) NormaliseName() string {
|
|
|
|
rgx := regexp.MustCompile(`[^a-z0-9]`)
|
|
|
|
return strings.ToLower(rgx.ReplaceAllString(link.Name, ""))
|
|
|
|
}
|