server

package
v0.0.0-...-2403d1f Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MIMEJSON              = "application/json"
	MIMEHTML              = "text/html"
	MIMEXML               = "application/xml"
	MIMEXML2              = "text/xml"
	MIMEPlain             = "text/plain"
	MIMEPOSTForm          = "application/x-www-form-urlencoded"
	MIMEMultipartPOSTForm = "multipart/form-data"
	MIMEPROTOBUF          = "application/x-protobuf"
)

Variables

View Source
var Server *_Server

Functions

func RegisterController

func RegisterController(c interface{})

Types

type CtrlBase

type CtrlBase struct {
	C *gin.Context
	// contains filtered or unexported fields
}

func (*CtrlBase) Abort

func (c *CtrlBase) Abort()

func (CtrlBase) IsJsonReqest

func (c CtrlBase) IsJsonReqest() bool

type Group

type Group struct {
	// contains filtered or unexported fields
}

func (*Group) Delete

func (g *Group) Delete(path string, action interface{})

func (*Group) Get

func (g *Group) Get(path string, action interface{})

func (*Group) Group

func (g *Group) Group(path string, mids ...interface{}) IGroup

func (*Group) Patch

func (g *Group) Patch(path string, action interface{})

func (*Group) Post

func (g *Group) Post(path string, action interface{})

type Hook

type Hook func()

type HtmlDebug

type HtmlDebug struct {
	Glob    string
	FuncMap temp.FuncMap
}

实现HTMLRender,主要用于调试时,可以实现动态加载有可以导入funcmap

func (HtmlDebug) Instance

func (r HtmlDebug) Instance(name string, data interface{}) render.Render

type IGroup

type IGroup interface {
	Get(path string, action interface{})
	Post(path string, action interface{})
	Patch(path string, action interface{})
	Delete(path string, action interface{})

	Group(path string, mid ...interface{}) IGroup
}

type IRouter

type IRouter interface {
	Public(url, path string)
	Group(relpath string, mid ...interface{}) IGroup
}

type RouteFunc

type RouteFunc func(IRouter)

type Router

type Router struct {
	// contains filtered or unexported fields
}

func (Router) Group

func (r Router) Group(relpath string, mids ...interface{}) IGroup

func (Router) Public

func (r Router) Public(url, path string)

type TmplHelper

type TmplHelper struct {
	E *gin.Engine
	// contains filtered or unexported fields
}

TmplHelper 用动态加载模板的辅助参数

func (*TmplHelper) LoadMainTmpl

func (th *TmplHelper) LoadMainTmpl(pattern string)

func (*TmplHelper) LoadView

func (th *TmplHelper) LoadView(pattern string)

Jump to

Keyboard shortcuts

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