fastic

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: MIT Imports: 9 Imported by: 0

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

View Source
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

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 New

func New() *App

this function maded for create new application model =D

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

func (a *App) Group(path string) *router.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) Print

func (a *App) Print(clr, model, message string)

the print function, maded for print your string on terminal =D

func (*App) PrintB

func (a *App) PrintB(clr, model string, message []byte)

printb method, this method get's byte.

func (*App) Run

func (app *App) Run(h fasthttp.RequestHandler)

a function for run server. and show default run server message to user.

func (*App) Static

func (a *App) Static(prefix, root string)

static router method maded for serve html,css ... files. u can use application.Static or application.Router.ServeFiles

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) Body

func (c *Ctx) Body() []byte

this method maded for show you a request body =D

func (*Ctx) FormValue

func (c *Ctx) FormValue(key string) string

FormValue method maded for show POST method value's

func (*Ctx) JSON

func (c *Ctx) JSON(data interface{}) error

this method maded for show your message as json message, chnages content website type to application/json

func (*Ctx) Param

func (c *Ctx) Param(key string) string

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

func (c *Ctx) Query(key string) string

this method maded for show paramter querys, example of querys: /example?name=value.

func (*Ctx) RawJSON

func (c *Ctx) RawJSON(rawJSON string)

func (*Ctx) Status

func (c *Ctx) Status(status int) *Ctx

Status method maded for change status code of ctx and return new ctx to user

func (*Ctx) String

func (c *Ctx) String(s string)

this method maded for show your message as text/plain model, if your website content type is application/json this method changes to text/plain and show's raw message on website.

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
}

func MdwNew

func MdwNew() *Mdw

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.

Jump to

Keyboard shortcuts

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