Documentation ¶
Overview ¶
Package anoweb doc
::anoweb::
The lightweight and powerful web framework using the new way for Go. Another go the way.
{{ Version @VER }}
{{ Powered by go-the-way }}
{{ https://github.com/go-the-way/anoweb }}
::quickstart::
package main
import (
"github.com/go-the-way/anoweb" "github.com/go-the-way/anoweb/context"
)
func main() { anoweb.Default.Get("/", func(ctx *context.Context) { ctx.Text("Hello world") }).Run() }
Index ¶
- Variables
- 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) FSResource(fs *embed.FS, pattern, file, contentType string) *App
- func (a *App) FaviconFS(fs *embed.FS) *App
- func (a *App) FaviconFile(file string) *App
- func (a *App) FaviconRoute(route string) *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() []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) Resource(pattern, file, contentType string) *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) UseFavicon() *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 ¶
View Source
var Default = New()
Default the default App
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct { ConfigFile string Config *config.Config // 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) FSResource ¶
FSResource Route a resource
func (*App) FaviconRoute ¶ added in v1.0.4
FaviconRoute Use Favicon File
func (*App) Middlewares ¶
func (a *App) Middlewares() []middleware.Middleware
Middlewares Filter Middlewares
func (*App) RecoveryConfig ¶
RecoveryConfig Sets Recovery config
func (*App) RecoveryHandler ¶
RecoveryHandler Sets Recovery handler
Source Files ¶
Click to show internal directories.
Click to hide internal directories.