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 rgx.ReplaceAllString(strings.ToLower(link.Name), "")
}
