wsgo

package
v2.0.0-...-8533a87 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Logger

func Logger(c *Context)

func NotFound

func NotFound(c *Context)

func ParseParamsJSON

func ParseParamsJSON(c *Context)

func ParseParamsQuery

func ParseParamsQuery(c *Context)

Types

type Context

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

func (*Context) AddParam

func (c *Context) AddParam(key string, v any)

func (*Context) AllParams

func (c *Context) AllParams() map[string][]any

func (*Context) AllStringParams

func (c *Context) AllStringParams() map[string][]string

func (*Context) BindJSON

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

func (*Context) ContentType

func (c *Context) ContentType() string

func (*Context) DefaultParam

func (c *Context) DefaultParam(k string, d any) any

func (*Context) DefaultQuery

func (c *Context) DefaultQuery(p string, defaultValue string) string

func (*Context) DefaultStringParam

func (c *Context) DefaultStringParam(k string, d string) string

func (*Context) DisableLog

func (c *Context) DisableLog()

func (*Context) EnableLog

func (c *Context) EnableLog()

func (*Context) GetRequest

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

func (*Context) GetResponseWriter

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

func (*Context) Json

func (c *Context) Json(code int, data any)

func (*Context) Log

func (c *Context) Log(format string, a ...any)

func (*Context) Next

func (c *Context) Next()

func (*Context) Param

func (c *Context) Param(k string) (any, bool)

func (*Context) Params

func (c *Context) Params() map[string]any

func (*Context) Query

func (c *Context) Query(p string) (string, bool)

func (*Context) ReadAllBody

func (c *Context) ReadAllBody() ([]byte, error)

func (*Context) StatusCode

func (c *Context) StatusCode(code int)

func (*Context) Stream

func (c *Context) Stream(code int, data []byte)

func (*Context) String

func (c *Context) String(code int, s string)

func (*Context) StringParam

func (c *Context) StringParam(k string) (string, bool)

func (*Context) StringParams

func (c *Context) StringParams() map[string]string

type H

type H map[string]any

type Handler

type Handler func(c *Context)

type ServerMux

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

func Default

func Default() *ServerMux

func New

func New() *ServerMux

func (*ServerMux) GET

func (p *ServerMux) GET(pattern string, handler ...Handler)

func (*ServerMux) Group

func (p *ServerMux) Group() *group

func (*ServerMux) Handle

func (p *ServerMux) Handle(pattern string, handler ...Handler)

func (*ServerMux) POST

func (p *ServerMux) POST(pattern string, handler ...Handler)

func (*ServerMux) Run

func (p *ServerMux) Run(addr string) error

func (*ServerMux) ServeHTTP

func (p *ServerMux) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*ServerMux) Use

func (p *ServerMux) Use(handler ...Handler)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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