httpserver

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Failure

func Failure(c *gin.Context, errCode int, errMsg string)

Failure 返回失败响应. trace 为底层详细错误.

func FailureWithHTTPStatus

func FailureWithHTTPStatus(c *gin.Context, httpStatus, errCode int, errMsg string)

FailureWithhttpStatus 返回指定http状态码的失败响应.

func NewRouter

func NewRouter(serviceRunMode string, profile bool) *gin.Engine

func Run

func Run(ctx context.Context, router http.Handler, servicePort string, graceful time.Duration) error

func Success

func Success(c *gin.Context, data interface{})

Success 返回成功响应.

Types

This section is empty.

Jump to

Keyboard shortcuts

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