Documentation ¶
Index ¶
- Variables
- type CreateURLRequest
- type URLService
- func (s *URLService) CreateShortURL(urlStr string) (*models.URL, error)
- func (s URLService) GetRecentURLs(limit int) ([]*models.URL, error)
- func (s URLService) GetStats() (*models.Stats, error)
- func (s *URLService) GetURL(code string) (*models.URL, error)
- func (s *URLService) IncrementVisits(code string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidURL = errors.New("invalid URL")
Functions ¶
This section is empty.
Types ¶
type CreateURLRequest ¶
type URLService ¶
type URLService struct {
// contains filtered or unexported fields
}
func NewURLService ¶
func NewURLService(repo repository.URLRepository) URLService
func (*URLService) CreateShortURL ¶
func (s *URLService) CreateShortURL(urlStr string) (*models.URL, error)
func (URLService) GetRecentURLs ¶
func (s URLService) GetRecentURLs(limit int) ([]*models.URL, error)
func (*URLService) IncrementVisits ¶
func (s *URLService) IncrementVisits(code string) error
Click to show internal directories.
Click to hide internal directories.