Documentation
¶
Overview ¶
▲ PLEASE DONT CHANGE THIS CODE THIS IS A DEFAULT APP CODE, CHANGEING THIS CODE CAN BROKE YOUR SITE.
▲ PLEASE DONT CHANGE THIS CODE THIS IS A DEFAULT APP CODE, CHANGEING THIS CODE CAN BROKE YOUR SITE.
▲ PLEASE DONT CHANGE THIS CODE THIS IS A DEFAULT APP CODE, CHANGEING THIS CODE CAN BROKE YOUR SITE.
▲ THIS FILE CODES THEY ARE ONLY EXAMPLE, THEY ARE NOT GOOD FOR REAL USE! PLEASE DONT USE THIS MIDDLEWARES FOR REAL PROJECT
▲ PLEASE DONT CHANGE THIS CODE THIS IS A DEFAULT APP CODE, CHANGEING THIS CODE CAN BROKE YOUR SITE.
▲ PLEASE DONT CHANGE THIS CODE THIS IS A DEFAULT APP CODE, CHANGEING THIS CODE CAN BROKE YOUR SITE.
Index ¶
- Constants
- func ChainMdw(handler fasthttp.RequestHandler, ...) fasthttp.RequestHandler
- type App
- func (a *App) DELETE(path string, handler RequestHandler, ...)
- func (a *App) GET(path string, handler RequestHandler, ...)
- func (a *App) Group(path string) *router.Group
- func (a *App) OPTIONS(path string, handler RequestHandler, ...)
- func (a *App) POST(path string, handler RequestHandler, ...)
- func (a *App) PUT(path string, handler RequestHandler, ...)
- func (a *App) Print(clr, model, message string)
- func (a *App) PrintB(clr, model string, message []byte)
- func (app *App) Run(h fasthttp.RequestHandler)
- func (a *App) Static(prefix, root string)
- type Ctx
- type Mdw
- type RequestHandler
Constants ¶
const ( // this is application version (only for display), // [WARNING] dont change this. Version = "v1.0" // this value is default ".env" file contents =D EnvFileContent = `` /* 4037-byte string literal not displayed */ )
default values, for see to all user's
Variables ¶
This section is empty.
Functions ¶
func ChainMdw ¶
func ChainMdw(handler fasthttp.RequestHandler, middlewares ...func(fasthttp.RequestHandler) fasthttp.RequestHandler) fasthttp.RequestHandler
this function maded for run multiplate middleware's. (use on main.go) # only for main middlewares
Types ¶
type App ¶
type App struct {
// router of fasthttp (if user need to other methods)
Router *router.Router
// handler for fasthttp, need this for run server. and load middlewares. =D
Handler fasthttp.RequestHandler
// router for env values (cache for speed responses)
Env *Env
// mdw for load chain middlewares and more =D
Mdw *Mdw
}
app structure example, you can add router and templates section!
func (*App) DELETE ¶
func (a *App) DELETE(path string, handler RequestHandler, middlewares ...func(RequestHandler) RequestHandler)
DELETE method example, you can use application.DELETE or application.Router.DELETE on your code.
func (*App) GET ¶
func (a *App) GET(path string, handler RequestHandler, middlewares ...func(RequestHandler) RequestHandler)
= - = - = - = - = - = - = - = - Request Methods = - = - = - = - = - = - = - = - [TIPS] if you need speed web application you can use application.Router.GET, if you need easy coding use application.GET =D GET method example, you can use application.GET or application.Router.GET on your code. [UPDATE] updated methods model with ctx because added cutsom ctx for requests
func (*App) Group ¶
= - = - = - = - = - = - = - = - Other Methods = - = - = - = - = - = - = - = - router group for creating groups and use custom middlewares for groups. u can use application.Router.Group() or application.Group()
func (*App) OPTIONS ¶
func (a *App) OPTIONS(path string, handler RequestHandler, middlewares ...func(RequestHandler) RequestHandler)
OPTIONS method example, you can use application.OPTIONS or application.Router.OPTIONS on your code.
func (*App) POST ¶
func (a *App) POST(path string, handler RequestHandler, middlewares ...func(RequestHandler) RequestHandler)
POST method example, you can use application.POST or application.Router.POST on your code.
func (*App) PUT ¶
func (a *App) PUT(path string, handler RequestHandler, middlewares ...func(RequestHandler) RequestHandler)
PUT method example, you can use application.PUT or application.Router.PUT on your code.
func (*App) Run ¶
func (app *App) Run(h fasthttp.RequestHandler)
a function for run server. and show default run server message to user.
type Ctx ¶
type Ctx struct {
*fasthttp.RequestCtx
}
create new structure named Ctx for create custom request ctx only for requests for fastic framework
func (*Ctx) JSON ¶
this method maded for show your message as json message, chnages content website type to application/json
func (*Ctx) Param ¶
this method is for use ctx paramter easy, UserValue is too hard for daily use they are created easy method named Param
func (*Ctx) Query ¶
this method maded for show paramter querys, example of querys: /example?name=value.
type Mdw ¶
type Mdw struct {
SChain func(handler fasthttp.RequestHandler, middlewares ...func(fasthttp.RequestHandler) fasthttp.RequestHandler) fasthttp.RequestHandler
Chain func(handler RequestHandler, middlewares ...func(RequestHandler) RequestHandler) RequestHandler
}
type RequestHandler ¶
type RequestHandler func(*Ctx)
handler function for fastic.
func ChainCtx ¶
func ChainCtx(handler RequestHandler, middlewares ...func(RequestHandler) RequestHandler) RequestHandler
this method maded for run other middlewares.