Documentation ¶
Overview ¶
Package shortener contains business-logic for url shortening.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrorURLNotFound is returned if given URL is not found in storage. ErrorURLNotFound = errors.New("url not found") )
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides functionality for URL storing and retrieving.
func NewService ¶
func NewService() Service
NewService returns new service instance with in-memory storage.
func (Service) RetrieveURL ¶
RetrieveURL returns full url by given short key. Returns ErrorURLNotFound if nothing exists.
Click to show internal directories.
Click to hide internal directories.