XWeb

package module
v0.0.0-...-3a0ae05 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

README

XWeb

Totally new version of rweb framework.

Documentation

Index

Constants

View Source
const (
	MethodPost = iota
	MethodGet
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

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

func (*Context) UserValue

func (z *Context) UserValue(key string) any

func (*Context) WriteJson

func (z *Context) WriteJson(object any) error

func (*Context) WriteString

func (z *Context) WriteString(str string) error

type DefaultRouter

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

func (*DefaultRouter) Bind

func (z *DefaultRouter) Bind(url string, method Method, handler Handler)

func (*DefaultRouter) Handler

func (z *DefaultRouter) Handler(ctx *fasthttp.RequestCtx)

type FasthttpRouter

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

推荐使用这个

func NewFasthttpRouter

func NewFasthttpRouter() FasthttpRouter

func (*FasthttpRouter) Bind

func (z *FasthttpRouter) Bind(address string, method Method, handler Handler)

func (*FasthttpRouter) Handler

func (z *FasthttpRouter) Handler(ctx *fasthttp.RequestCtx)

type Handler

type Handler func(ctx *Context)

type Method

type Method int

type Node

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

type Router

type Router interface {
	Bind(url string, method Method, handler Handler)
	Handler(ctx *fasthttp.RequestCtx)
}

func NewDefaultRouter

func NewDefaultRouter() Router

type XWeb

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

func NewEngine

func NewEngine() XWeb

func (*XWeb) RunAndServe

func (z *XWeb) RunAndServe(address string) error

func (*XWeb) RunAndServerTLS

func (z *XWeb) RunAndServerTLS(address string, certData []byte, keyData []byte) error

func (*XWeb) SetRouter

func (z *XWeb) SetRouter(router Router)

Jump to

Keyboard shortcuts

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