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