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 }