server

package
v0.0.0-...-066ace4 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildHandle

func BuildHandle(handler func(ctx *GinContext)) gin.HandlerFunc

包装为,自定义的GinContext

Types

type AuthCookie

type AuthCookie struct {
	Token       string
	AccountId   int64
	AccountName string
	Name        string
}

func (*AuthCookie) IsValidate

func (a *AuthCookie) IsValidate() bool

func (*AuthCookie) Parse

func (a *AuthCookie) Parse(ctx *GinContext)

type GinContext

type GinContext struct {
	*gin.Context
	AuthCookie *AuthCookie
}

func (*GinContext) CookieInt

func (c *GinContext) CookieInt(name string, defaultValue int) int

func (*GinContext) CookieInt64

func (c *GinContext) CookieInt64(name string, defaultValue int64) int64

func (*GinContext) Error

func (c *GinContext) Error(msg string)

func (*GinContext) HTML

func (c *GinContext) HTML(name string, obj interface{})

func (*GinContext) JSON

func (c *GinContext) JSON(value interface{})

func (*GinContext) Object

func (c *GinContext) Object(obj interface{})

func (*GinContext) Ok

func (c *GinContext) Ok()

func (*GinContext) Pagination

func (c *GinContext) Pagination(total int, rows interface{})

func (*GinContext) PaginationMsg

func (c *GinContext) PaginationMsg(total int, rows interface{}, msg string)

func (*GinContext) PostInt

func (c *GinContext) PostInt(name string, defaultValue int) int

func (*GinContext) PostInt64

func (c *GinContext) PostInt64(name string, defaultValue int64) int64

func (*GinContext) QueryInt

func (c *GinContext) QueryInt(name string, defaultValue int) int

func (*GinContext) QueryInt64

func (c *GinContext) QueryInt64(name string, defaultValue int64) int64

func (*GinContext) SetCookie

func (c *GinContext) SetCookie(name, value string)

type IController

type IController interface {
	Init(*gin.Engine)
}

type WebServer

type WebServer struct {
	*gin.Engine
	// contains filtered or unexported fields
}
var Web *WebServer

web server instance

func New

func New() *WebServer

func (*WebServer) AddController

func (w *WebServer) AddController(controllers ...IController)

func (*WebServer) Do

func (w *WebServer) Do(f func(s *gin.Engine))

func (*WebServer) Run

func (w *WebServer) Run()

Jump to

Keyboard shortcuts

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