wisp

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2025 License: MIT Imports: 12 Imported by: 0

README

go-wisp

Wisp is a lightweight and high-performance web framework for Go, built on top of httprouter. It focuses on minimalism, fast routing, and giving developers full control without the clutter.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

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

func (*Context) BadRequest

func (c *Context) BadRequest(e error) error

func (*Context) BindForm

func (c *Context) BindForm() (url.Values, error)

func (*Context) BindJSON

func (c *Context) BindJSON(dest interface{}) error

func (*Context) BindMultipartForm

func (c *Context) BindMultipartForm(maxMemory int64) error

func (*Context) BindXML

func (c *Context) BindXML(dest interface{}) error

func (*Context) Context

func (c *Context) Context() context.Context

func (*Context) Cookie

func (c *Context) Cookie(name string) (*http.Cookie, error)

func (*Context) Done

func (c *Context) Done() <-chan struct{}

func (*Context) Err

func (c *Context) Err() error

func (*Context) FormInt

func (c *Context) FormInt(name string) (int, error)

func (*Context) FormIntDefault

func (c *Context) FormIntDefault(name string, defaultValue int) int

func (*Context) FormValue

func (c *Context) FormValue(name string) string

func (*Context) FormValueDefault

func (c *Context) FormValueDefault(name, defaultValue string) string

func (*Context) InternalServerError

func (c *Context) InternalServerError(e error) error

func (*Context) JSON

func (c *Context) JSON(status int, data any) error

func (*Context) NoContent

func (c *Context) NoContent()

func (*Context) NotFound

func (c *Context) NotFound()

func (*Context) Param

func (c *Context) Param(name string) string

func (*Context) ParamInt

func (c *Context) ParamInt(name string) (int, error)

func (*Context) ParamIntDefault

func (c *Context) ParamIntDefault(name string, defaultValue int) int

func (*Context) Params

func (c *Context) Params() httprouter.Params

func (*Context) Query

func (c *Context) Query(name string) string

func (*Context) QueryDefault

func (c *Context) QueryDefault(name, defaultValue string) string

func (*Context) QueryInt

func (c *Context) QueryInt(name string) (int, error)

func (*Context) QueryIntDefault

func (c *Context) QueryIntDefault(name string, defaultValue int) int

func (*Context) Redirect

func (c *Context) Redirect(status int, urlStr string)

func (*Context) Request

func (c *Context) Request() *http.Request

func (*Context) Response

func (c *Context) Response() http.ResponseWriter

func (*Context) SetCookie

func (c *Context) SetCookie(cookie *http.Cookie)

func (*Context) SetValue

func (c *Context) SetValue(key, val any)

func (*Context) Status

func (c *Context) Status(code int)

func (*Context) String

func (c *Context) String(status int, s string) error

func (*Context) Value

func (c *Context) Value(key any) any

func (*Context) Write

func (c *Context) Write(data []byte) (int, error)

func (*Context) XML

func (c *Context) XML(status int, data any) error

type ErrorHandler

type ErrorHandler func(err error, ctx *Context) error

type Group

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

func (*Group) DELETE

func (g *Group) DELETE(path string, h Handler, mws ...Middleware)

func (*Group) GET

func (g *Group) GET(path string, h Handler, mws ...Middleware)

func (*Group) HEAD

func (g *Group) HEAD(path string, h Handler, mws ...Middleware)

func (*Group) OPTIONS

func (g *Group) OPTIONS(path string, h Handler, mws ...Middleware)

func (*Group) PATCH

func (g *Group) PATCH(path string, h Handler, mws ...Middleware)

func (*Group) POST

func (g *Group) POST(path string, h Handler, mws ...Middleware)

func (*Group) PUT

func (g *Group) PUT(path string, h Handler, mws ...Middleware)

func (*Group) Static

func (g *Group) Static(relativePath, root string)

func (*Group) Use

func (g *Group) Use(m ...Middleware)

type Handler

type Handler func(ctx *Context) error

type Middleware

type Middleware func(next Handler) Handler

type Wisp

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

func New

func New() *Wisp

func (*Wisp) DELETE

func (w *Wisp) DELETE(path string, h Handler, mws ...Middleware)

func (*Wisp) GET

func (w *Wisp) GET(path string, h Handler, mws ...Middleware)

func (*Wisp) Group

func (w *Wisp) Group(prefix string, middlewares ...Middleware) *Group

func (*Wisp) HEAD

func (w *Wisp) HEAD(path string, h Handler, mws ...Middleware)

func (*Wisp) OPTIONS

func (w *Wisp) OPTIONS(path string, h Handler, mws ...Middleware)

func (*Wisp) PATCH

func (w *Wisp) PATCH(path string, h Handler, mws ...Middleware)

func (*Wisp) POST

func (w *Wisp) POST(path string, h Handler, mws ...Middleware)

func (*Wisp) PUT

func (w *Wisp) PUT(path string, h Handler, mws ...Middleware)

func (*Wisp) SetErrorHandler

func (w *Wisp) SetErrorHandler(errorHandler ErrorHandler)

func (*Wisp) Start

func (w *Wisp) Start(addr string) error

func (*Wisp) StartWithTLS

func (w *Wisp) StartWithTLS(addr, certFile, keyFile string) error

func (*Wisp) Static

func (w *Wisp) Static(path, root string)

func (*Wisp) Use

func (w *Wisp) Use(m ...Middleware)

Jump to

Keyboard shortcuts

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