controllers

package
v0.0.0-...-0f2f850 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

DbClient DB client interface

View Source
var Timeout time.Duration

Timeout mongo and gin-gonic context timout

Functions

func CreateShortUrl

func CreateShortUrl(c *gin.Context)

CreateShortUrl ... creates the md5 hash of given URL string and stores it in DB @Summary Creates the md5 hash of given URL string and stores it in DB @Description Create new hash:url couple from given url @Tags ShortUrl @Accept json @Param user body model.ShortUrlReq true "Short Url Request" @Success 200 {object} model.ShortUrl @Failure 400,500 {object} object @Router /short-url [post]

func GetUrlByHash

func GetUrlByHash(c *gin.Context)

GetUrlByHash ... get URL string from given hash of it @Summary Get URL string of a hash @Description get URL string from given hash of it @Tags ShortUrl @Param id path string true "Hash String" @Success 200 {object} model.ShortUrl @Failure 404 {object} object @Router /short-url/{id} [get]

Types

This section is empty.

Jump to

Keyboard shortcuts

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