controller

package
v0.0.0-...-969def7 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheLongUrl

func CacheLongUrl(shortId string, longUrl string) error

func CreateUrl

func CreateUrl(c *gin.Context)

func GetShortId

func GetShortId() (string, error)

func RedirectUrl

func RedirectUrl(c *gin.Context)

func SendErrorResponse

func SendErrorResponse(c *gin.Context, statusCode int, message string)

Types

type Request

type Request struct {
	LongUrl string `json:"url"`
}

type Response

type Response struct {
	Url         string
	CustomShort string
	Expiry      time.Duration
}

Jump to

Keyboard shortcuts

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