violet/target/redirect.go
2023-04-19 01:30:23 +01:00

16 lines
194 B
Go

package target
import (
"net/http"
"net/url"
)
type Redirect struct {
url.URL
Code int
}
func (r Redirect) Handler() http.Handler {
return http.RedirectHandler(r.URL.String(), r.Code)
}