controller

package
v0.0.0-...-790158a Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RedirectHandler

func RedirectHandler(w http.ResponseWriter, r *http.Request)

@Tag User @Title Redirect to Short URL destination - API @Description Responds with the destination URL for the Short URL specified. @Param shortURL path string @Success 302 (object) string Destination of Short URL @Router /api/v1/redirect/{shortURL}

func Router

func Router() *mux.Router

func ShortenURLHandler

func ShortenURLHandler(w http.ResponseWriter, r *http.Request)

@Tag User @Title Create Short URL - API @Description Creates an expirable short URL for the given URL @Param request body model.CreateShortURLRequest @Success 200 (object) model.ShortenedURLResponse Shortened URL response @Router /api/v1/shorten-url [post]

func ShortenedURLInfoHandler

func ShortenedURLInfoHandler(w http.ResponseWriter, r *http.Request)

@Tag User @Title Retrieve Info on Short URL - API @Description Retrieves information about the short URL, when it was created, what it points to and when it will expire. @Param shortUrl path string @Success 200 (object) model.ShortenedURL Info about the short URL @Router /api/v1/shortened-url/{shortUrl} [get]

Types

This section is empty.

Jump to

Keyboard shortcuts

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