server

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2022 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cors

func Cors() gin.HandlerFunc

Cors 配置允许跨域请求

func Engine

func Engine() *gin.Engine

func InitServer

func InitServer(port int)

func RegisterPlugin

func RegisterPlugin(plugin gin.HandlerFunc)

func RegisterRoute

func RegisterRoute(path string, method HttpMethod, handler gin.HandlerFunc)

func RegisterStatic

func RegisterStatic(relativePath string, rootPath string)

func RegisterStaticFile

func RegisterStaticFile(relativePath string, filePath string)

func StartServer

func StartServer()

Types

type HttpMethod

type HttpMethod int
const (
	HmAll HttpMethod = iota
	HmGet
	HmPost
	HmPut
	HmDelete
	HmOptions
	HmHead
	HmGetPost
)

Jump to

Keyboard shortcuts

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