Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DbClient model.DbConnector
DbClient DB client interface
var Timeout time.Duration
Timeout mongo and gin-gonic context timout
Functions ¶
func CreateShortUrl ¶
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 ¶
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.