Documentation
¶
Index ¶
- Constants
- func BuildEngine(appService *entity.ServiceProvider) *gin.Engine
- func HealthCheck(c *gin.Context)
- func ParseURL(c *gin.Context, appService *entity.ServiceProvider)
- func ShortenURL(c *gin.Context, appService *entity.ServiceProvider)
- func Start(addr string, appService *entity.ServiceProvider)
- func WrapeService(appService *entity.ServiceProvider, handler RequestHandler) gin.HandlerFunc
- type RequestHandler
Constants ¶
View Source
const ( HealthStatus = "health" ShortPathExisted = "short path has existed." ShortenURLSuccess = "shorten url success." )
Variables ¶
This section is empty.
Functions ¶
func BuildEngine ¶
func BuildEngine(appService *entity.ServiceProvider) *gin.Engine
BuildEngine return gin.Engine with route
func HealthCheck ¶
func ParseURL ¶
func ParseURL(c *gin.Context, appService *entity.ServiceProvider)
ParseURL parse shorten path and return source url
func ShortenURL ¶
func ShortenURL(c *gin.Context, appService *entity.ServiceProvider)
ShortenURL shorten origin url and save to db
func WrapeService ¶
func WrapeService(appService *entity.ServiceProvider, handler RequestHandler) gin.HandlerFunc
Types ¶
type RequestHandler ¶
type RequestHandler func(*gin.Context, *entity.ServiceProvider)
Click to show internal directories.
Click to hide internal directories.