HOLY REFACTOR GOOD GRIEF (also finally started some CRUD work)
Signed-off-by: ari melody <ari@arimelody.me>
This commit is contained in:
parent
1c310c9101
commit
442889340c
80 changed files with 1571 additions and 1330 deletions
16
music/model/link.go
Normal file
16
music/model/link.go
Normal 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, ""))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue