🏷️ Added IsMatch method for redirect domain

This commit is contained in:
Maxim Lebedev 2023-12-09 12:42:45 +06:00
parent 0c2f6b560b
commit 739a38eb4c
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5
1 changed files with 11 additions and 0 deletions

View File

@ -1,8 +1,19 @@
package domain
import "path"
type Redirect struct {
From string
To string
Status int
Force bool
}
func (r Redirect) IsMatch(p string) bool {
matched, err := path.Match(r.From, p)
if err != nil {
return false
}
return matched
}