123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- 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
- }
|