service

package
v0.0.0-...-15f6c86 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidURL = errors.New("invalid URL")

Functions

This section is empty.

Types

type CreateURLRequest

type CreateURLRequest struct {
	URL        string `json:"url"`
	CustomCode string `json:"custom_code,omitempty"`
}

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) GetStats

func (s URLService) GetStats() (*models.Stats, error)

func (*URLService) GetURL

func (s *URLService) GetURL(code string) (*models.URL, error)

func (*URLService) IncrementVisits

func (s *URLService) IncrementVisits(code string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL