package future import ( "code.osinet.fr/fgm/kurz/domain" "net/url" ) /* Domain represents a DNS domain. */ type Domain interface { String() string } /* HTTPStatus is a subset of int limited to the values enumerated in net/http, like StatusOK (200) or StatusNotFound (404). */ type HTTPStatus interface { Int() int } /** HTTPRedirectStatus is a subset of HTTPStatus limited to the values from 300 to 399. */ type HTTPRedirectStatus HTTPStatus type ShortURLAssigner interface { GenerateShortURLFromTarget(TargetURL, DomainController) (domain.ShortURL, error) RegisterShortURLForTarget(domain.ShortURL, TargetURL, DomainController) error } type ShortURLResolver interface { TargetURLFromShortURL(domain.ShortURL) (TargetURL, error) } type TargetURL interface { AllowedRedirectStatuses() []HTTPRedirectStatus DefaultRedirectStatus() HTTPRedirectStatus RedirectURL() url.URL } type DomainController interface { ControlledDomains() []Domain }