home/internal/domain/redirect.go

17 lines
211 B
Go

package domain
import "path"
type Redirect struct {
From string
To string
Status int
Force bool
}
func (r Redirect) IsMatch(p string) bool {
matched, _ := path.Match(r.From, p)
return matched
}