web

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplicationLogger

func ApplicationLogger()

application log

func ApplicationLoggerFlush

func ApplicationLoggerFlush()

func Default

func Default() *gin.Engine

func Setup

func Setup(rootPath string, r GinGrouper, controller Controller)

func Success

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

func Write

func Write(c *gin.Context, code int, data interface{})

Types

type ApiResponse

type ApiResponse struct {
	Code int         `json:"code"`
	Msg  string      `json:"msg"`
	Data interface{} `json:"data"`
}

type Controller

type Controller interface {
	RequestMappings() []Handler
}

type GinGrouper

type GinGrouper interface {
	Group(relativePath string, handlers ...gin.HandlerFunc) *gin.RouterGroup
}

type Handler

type Handler struct {
	Method      string
	Path        string
	HandlerFunc gin.HandlerFunc
}

type Logger

type Logger interface {
	Init() error
	Write(s *msgFmt)
	Flush()
	Logger() gin.HandlerFunc
}

func NewLogger

func NewLogger() Logger

Jump to

Keyboard shortcuts

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