Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrURLNotFound error = errors.New("URL not found")
ErrURLNotFound Url not found in urlList
Functions ¶
Types ¶
type URL ¶
type URL struct {
ID int `json:"id" validate:"isdefault"`
OriginalURL string `json:"url" validate:"required"`
ShortURL string `json:"shortened_url" validate:"isdefault"`
}
URL struct for storing url details
type Urls ¶
type Urls struct {
// contains filtered or unexported fields
}
Urls is a collection of URL
func (*Urls) GetURLByLong ¶
GetURLByLong returns the URL struct with given original url from urlList returns ErrUrlNotFOund if url does not exists in urlList
func (*Urls) GetURLByShort ¶
GetURLByShort return the URL struct with given shortened URL from urlList
Click to show internal directories.
Click to hide internal directories.