target_url.go 461 B

1234567891011121314151617181920
  1. package domain
  2. type TargetURL struct {
  3. URL
  4. }
  5. func (tu TargetURL) IsEmpty() bool {
  6. return &tu == nil || tu.URL.IsEmpty()
  7. }
  8. /*
  9. MayRedirect defines whether the Target may be used in a redirection.
  10. In the current version, any non empty RedirectURL may be used. In future versions, some
  11. restrictions like blocked URLs or even whole domains may limit the availability
  12. of a target RedirectURL.
  13. */
  14. func (tu TargetURL) MayRedirect() bool {
  15. return !tu.IsEmpty()
  16. }