123456789101112131415161718192021222324252627 |
- package domain
- var shortURLRepository ShortURLRepository
- var targetURLRepository TargetURLRepository
- func GetTargetURL(shortURL string) (string, error) {
- return "", nil
- }
- func GetShortURL(targetURL string) (string, error) {
- return "", nil
- }
- type ShortURLRepository interface {
- GetTarget(su ShortURL) (TargetURL, error)
- GetByTarget(tu TargetURL) (ShortURL, error)
- }
- type TargetURLRepository interface {
- GetShort(tu TargetURL) (ShortURL, error)
- GetByShort(su ShortURL) (TargetURL, error)
- }
- func RegisterRepositories(sur ShortURLRepository, tur TargetURLRepository) {
- shortURLRepository = sur
- targetURLRepository = tur
- }
|