server

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2022 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ApiPrefix = "/api"

Functions

func Cors

func Cors() gin.HandlerFunc

Cors 配置允许跨域请求

func Engine

func Engine() *gin.Engine

func InitServer

func InitServer()

func RegisterConfigWatchEndpoint added in v0.3.0

func RegisterConfigWatchEndpoint(apiBase string)

func RegisterCustomHealthCheck added in v0.2.0

func RegisterCustomHealthCheck(apiBase string, status func() string, init func() string, destroy func() string)

func RegisterHealthCheckEndpoint added in v0.3.0

func RegisterHealthCheckEndpoint(apiBase string)

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 RegisterWebSocketRoute added in v0.8.0

func RegisterWebSocketRoute(path string, svr *websocket.Server)

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