goskeleton

package module
v0.0.0-...-72f167c Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

README

goskeleton

Web server skeleton for golang.

Documentation

Index

Constants

View Source
const (
	CTX_KEY_REQUEST_INJECTOR = "REQUEST_INJECTOR"
)

Variables

View Source
var RecordHttp bool

Functions

func GetInjector

func GetInjector(c *gin.Context) inject.Injector

func LoadDataFromFile

func LoadDataFromFile(injector inject.Injector, data interface{}, ctxFilePath string) error

func ParseFormHandler

func ParseFormHandler(formValue interface{}) func(c *gin.Context)

func RecordHttpHandler

func RecordHttpHandler(c *gin.Context)

用于记录HTTP 请求/响应内容,以便于开发调试

Types

type ContextPostLoad

type ContextPostLoad interface {
	PostLoad()
}

type Engine

type Engine struct {
	*gin.Engine
	Injector inject.Injector
}

func New

func New(groups map[string]GroupDefine, ctx interface{}, ctxFilePath string, middlewares ...gin.HandlerFunc) *Engine

type GroupDefine

type GroupDefine struct {
	Routes     Routes
	Middlwares []gin.HandlerFunc
	Intro      string
}

type Middlwares

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

func NewMiddlwares

func NewMiddlwares(handlers ...gin.HandlerFunc) *Middlwares

func (*Middlwares) Bind

func (me *Middlwares) Bind(formValue interface{}) *Middlwares

func (*Middlwares) BindForm

func (me *Middlwares) BindForm(formValue interface{}) *Middlwares

type ObjectInit

type ObjectInit interface {
	Init()
}

type Route

type Route struct {
	Pattern    string
	Handler    interface{}
	Form       interface{}
	Middlwares []gin.HandlerFunc
	Intro      string
}

type Routes

type Routes []Route

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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