shortener

package
v0.0.0-...-7ba1b10 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSingleOrAllShortenedUrls

func GetSingleOrAllShortenedUrls(ctx *gin.Context, db *gorm.DB)

func RedirectShortenedUrlToOriginalUrl

func RedirectShortenedUrlToOriginalUrl(ctx *gin.Context, db *gorm.DB)

func ShortenUrl

func ShortenUrl(ctx *gin.Context, db *gorm.DB)

func ShortenerRoutes

func ShortenerRoutes(e *gin.Engine, rg *gin.RouterGroup, db *gorm.DB)

Types

type ShortenerResponse

type ShortenerResponse struct {
	Original  string `json:"original" gorm:"unique"`
	Short     string `json:"short"`
	CreatedAt int64  `json:"created_at"`
}

type ShoternerRequest

type ShoternerRequest struct {
	Original string `json:"original"`
}

Jump to

Keyboard shortcuts

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