server

package
v0.0.0-...-ef910b2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2020 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

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 HealthCheck(c *gin.Context)

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 Start

func Start(addr string, appService *entity.ServiceProvider)

Start start server

func WrapeService

func WrapeService(appService *entity.ServiceProvider, handler RequestHandler) gin.HandlerFunc

Types

type RequestHandler

type RequestHandler func(*gin.Context, *entity.ServiceProvider)

Jump to

Keyboard shortcuts

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