Documentation ¶
Overview ¶
Package flygo doc
A simple and lightweight web framework, pure native and no third dependencies.
::quickstart::
package main
import (
"github.com/billcoding/flygo" "github.com/billcoding/flygo/context"
)
func main() { flygo.GetApp().Get("/", func(ctx *context.Context) { ctx.Text("Hello world") }).Run() }
Index ¶
- type App
- func (a *App) AddRouter(r ...*router.Router) *App
- func (a *App) AddRouterGroup(g ...*router.Group) *App
- func (a *App) Controller(c ...rest.Controller) *App
- func (a *App) Delete(pattern string, handler func(ctx *context.Context)) *App
- func (a *App) Get(pattern string, handler func(ctx *context.Context)) *App
- func (a *App) Head(pattern string, handler func(ctx *context.Context)) *App
- func (a *App) Middlewares(_ *context.Context) []middleware.Middleware
- func (a *App) Options(pattern string, handler func(ctx *context.Context)) *App
- func (a *App) Patch(pattern string, handler func(ctx *context.Context)) *App
- func (a *App) Post(pattern string, handler func(ctx *context.Context)) *App
- func (a *App) Put(pattern string, handler func(ctx *context.Context)) *App
- func (a *App) RecoveryConfig(codeName string, codeVal int, msgName string) *App
- func (a *App) RecoveryHandler(handlers ...func(ctx *context.Context)) *App
- func (a *App) Request(pattern string, handler func(ctx *context.Context)) *App
- func (a *App) Route(method, pattern string, handler func(ctx *context.Context)) *App
- func (a *App) Run()
- func (a *App) Use(middlewares ...middleware.Middleware) *App
- func (a *App) UseHandler(method, pattern string, middlewares ...middleware.Middleware) *App
- func (a *App) UseHeader() *App
- func (a *App) UseLogger() *App
- func (a *App) UseRecovery() *App
- func (a *App) UseSession(provider session.Provider, config *session.Config, listener *session.Listener) *App
- func (a *App) UseStatic(cache bool, root, prefix string) *App
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct { ConfigFile string Config *config.Config Logger *logrus.Logger // contains filtered or unexported fields }
App struct
func (*App) AddRouterGroup ¶
AddRouterGroup Add Group Routers
func (*App) Controller ¶
func (a *App) Controller(c ...rest.Controller) *App
Controller Route REST-ful Controller
func (*App) Middlewares ¶
func (a *App) Middlewares(_ *context.Context) []middleware.Middleware
Middlewares Filter Middlewares
func (*App) RecoveryConfig ¶
RecoveryConfig Sets Recovery config
func (*App) RecoveryHandler ¶
RecoveryHandler Sets Recovery handler
func (*App) UseHandler ¶
func (a *App) UseHandler(method, pattern string, middlewares ...middleware.Middleware) *App
UseHandler middlewares
Source Files ¶
Click to show internal directories.
Click to hide internal directories.