home/internal/domain/redirect.go

17 lines
211 B
Go
Raw Normal View History

2023-12-09 06:01:49 +00:00
package domain
import "path"
2023-12-09 06:01:49 +00:00
type Redirect struct {
From string
To string
Status int
Force bool
}
func (r Redirect) IsMatch(p string) bool {
2023-12-24 01:54:04 +00:00
matched, _ := path.Match(r.From, p)
return matched
}