drip

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2025 License: MIT Imports: 14 Imported by: 0

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

func (c *Context) Broadcast(path string, msg []byte) error

func (*Context) Bytes

func (c *Context) Bytes(statusCode int, data []byte, contentType string) error

func (*Context) ClientIP

func (c *Context) ClientIP() string

func (*Context) Cookie

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

func (*Context) File

func (c *Context) File(filePath string) error

func (*Context) FormFile

func (c *Context) FormFile(field string) (multipart.File, error)

func (*Context) HTML

func (c *Context) HTML(statusCode int, html string) error

func (*Context) Header

func (c *Context) Header(key string) string

func (*Context) JSON

func (c *Context) JSON(statusCode int, v any) error

func (*Context) Param

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

func (*Context) ParseForm

func (c *Context) ParseForm(v any) error

func (*Context) ParseJSON

func (c *Context) ParseJSON(v any) error

func (*Context) ParseMultipartForm

func (c *Context) ParseMultipartForm(v any, maxMemory int64) error

func (*Context) ParseQuery

func (c *Context) ParseQuery(v any) error

func (*Context) ParseXML

func (c *Context) ParseXML(v any) error

func (*Context) Query

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

func (*Context) Redirect

func (c *Context) Redirect(statusCode int, url string) error

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

func (c *Context) SetHeader(key, value string)

func (*Context) SetValue

func (c *Context) SetValue(key ContextKey, value any)

func (*Context) Status

func (c *Context) Status(statusCode int)

func (*Context) Text

func (c *Context) Text(statusCode int, message string) error

func (*Context) UserAgent

func (c *Context) UserAgent() string

func (*Context) Value

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

type ContextKey

type ContextKey string

type Drip

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

func New

func New() *Drip

func (*Drip) DELETE

func (d *Drip) DELETE(path string, h Handler, middlewares ...Middleware)

func (*Drip) GET

func (d *Drip) GET(path string, h Handler, middlewares ...Middleware)

func (*Drip) Group

func (d *Drip) Group(prefix string) *Group

func (*Drip) HEAD

func (d *Drip) HEAD(path string, h Handler, middlewares ...Middleware)

func (*Drip) OPTIONS

func (d *Drip) OPTIONS(path string, h Handler, middlewares ...Middleware)

func (*Drip) PATCH

func (d *Drip) PATCH(path string, h Handler, middlewares ...Middleware)

func (*Drip) POST

func (d *Drip) POST(path string, h Handler, middlewares ...Middleware)

func (*Drip) PUT

func (d *Drip) PUT(path string, h Handler, middlewares ...Middleware)

func (*Drip) Router added in v1.0.1

func (d *Drip) Router() *httprouter.Router

func (*Drip) SetErrorHandler

func (d *Drip) SetErrorHandler(errorHandler ErrorHandler)

func (*Drip) Start

func (d *Drip) Start(listenAddr string) error

func (*Drip) StartTLS

func (d *Drip) StartTLS(listenAddr, certFile, keyFile string) error

func (*Drip) Static

func (d *Drip) Static(prefix, root string, middlewares ...Middleware)

func (*Drip) Use

func (d *Drip) Use(middlewares ...Middleware)

func (*Drip) Websocket

func (d *Drip) Websocket(path string, middlewares ...Middleware)

type ErrorHandler

type ErrorHandler func(err error, ctx *Context)

type Group

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

func (*Group) DELETE

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

func (*Group) GET

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

func (*Group) Group

func (g *Group) Group(prefix string) *Group

func (*Group) HEAD

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

func (*Group) OPTIONS

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

func (*Group) PATCH

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

func (*Group) POST

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

func (*Group) PUT

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

func (*Group) Static

func (g *Group) Static(prefix, root string, middlewares ...Middleware)

func (*Group) Use

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

func (*Group) Websocket

func (g *Group) Websocket(path string, middlewares ...Middleware)

type Handler

type Handler func(ctx *Context) error

type Json

type Json map[string]any

type Middleware

type Middleware func(next Handler) Handler

type WebsocketManager

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

func (*WebsocketManager) Broadcast

func (wm *WebsocketManager) Broadcast(path string, msg []byte) error

Jump to

Keyboard shortcuts

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