Documentation ¶
Index ¶
- func CreateURLShortCode(input request.URLInput) (string, error)
- func CreateURLShortCodeFromRequest(req *http.Request) (string, error)
- func DeleteURLByShortCode(shortCode string) error
- func DeleteURLFromRequest(req *http.Request) error
- func IncrementHits(urlModel model.URL)
- func ListURLsFiltered(filter request.URLFilter) ([]model.URL, error)
- func ListURLsFilteredFromRequest(req *http.Request) ([]model.URL, error)
- func LookupOriginURL(shortCode string) (model.URL, int, bool)
- func ValidateURLInput(input request.URLInput) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateURLShortCode ¶
CreateURLShortCode creates a new short code using request.URLInput It returns created short code or error if any.
func CreateURLShortCodeFromRequest ¶
CreateURLShortCodeFromRequest creates a new short code for url given in http.Request It uses expires_on date and keywords from http.Request if available. It returns created short code or error if any.
func DeleteURLByShortCode ¶
DeleteURLByShortCode deletes url using short code It returns error on failure.
func DeleteURLFromRequest ¶
DeleteURLFromRequest deletes url using short code from request It returns error on failure.
func IncrementHits ¶
IncrementHits increments hit counter for given shortCode just before serving redirection
func ListURLsFiltered ¶
ListURLsFiltered gets list of urls filtered using request.URLFilter It returns list of matching model.URL arrays and error if nothing matched.
func ListURLsFilteredFromRequest ¶
ListURLsFilteredFromRequest gets list of urls filtered using http.Request query params It returns list of matching model.URL arrays and error if nothing matched.
func LookupOriginURL ¶
LookupOriginURL looks up origin url from shortCode It returns origin url if exists and is active, http error code otherwise.
Types ¶
This section is empty.