Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ShortenerCacheRepo ¶
type ShortenerCacheRepo interface { GetAllURL(userID string) ([]entity.URL, error) GetURL(shortURL string) (string, error) SetURL(url entity.URL) error DeleteURL(shortURL string) (int64, error) IsSingleURLExist(shortURL string) (bool, error) HasShortURLExpired(shortURL string) (bool, error) IsCollectionURLExist(userID string) (bool, error) }
ShortenerCacheRepo contains repo for all URL Shortener Cache
type ShortenerDBRepo ¶
type ShortenerDBRepo interface { GetAllURL(userID string) ([]entity.URL, error) GetURL(shortURL string) (entity.URL, error) CreateNewShortURL(url entity.URL) error UpdateShortURL(shortURL string, longURL string) error DeleteURL(shortURL string) error IsShortURLExist(shortURL string) bool HasShortURLExpired(shortURL string) bool }
ShortenerDBRepo contains repo for all URL Shortener DB
type ShortenerUC ¶
type ShortenerUC interface { GetAllURL(userID string) ([]entity.URL, error) CreateNewShortURL(longURL string) (entity.URL, error) CreateNewCustomShortURL(shortURL string, longURL string) (entity.URL, error) UpdateShortURL(shortURL string, longURL string) error GetLongURL(shortURL string) (string, error) DeleteURL(shortURL string) error GenerateShortURL(length int) string IsValidURL(url string) (string, error) }
ShortenerUC contains logic for all URL Shortener Usecase
Directories ¶
Path | Synopsis |
---|---|
delivery
|
|
repo
|
|
cache/redis
Package redis is a generated GoMock package.
|
Package redis is a generated GoMock package. |
db/postgres
Package postgres is a generated GoMock package.
|
Package postgres is a generated GoMock package. |
Package usecase is a generated GoMock package.
|
Package usecase is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.