move models, views, and controllers to root

This commit is contained in:
ari melody 2024-11-01 19:33:26 +00:00
parent f0d29126ab
commit 96cc64464f
Signed by: ari
GPG key ID: CF99829C92678188
21 changed files with 190 additions and 203 deletions

16
model/link.go Normal file
View file

@ -0,0 +1,16 @@
package model
import (
"regexp"
"strings"
)
type Link struct {
Name string `json:"name"`
URL string `json:"url"`
}
func (link Link) NormaliseName() string {
rgx := regexp.MustCompile(`[^a-z0-9]`)
return strings.ToLower(rgx.ReplaceAllString(link.Name, ""))
}