web

package
v0.2.38 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFilter added in v0.0.4

func AddFilter(pattern string, pos int, filterFunc context.HandlerFunc)

AddFilter 添加过滤

func Any

func Any(rootPath string, fun context.HandlerFunc)

Any 任何请求

func Delete

func Delete(rootPath string, fun context.HandlerFunc)

Delete 请求

func Delims

func Delims(left, right string)

Delims

func EnableLimiting added in v0.0.31

func EnableLimiting(limitType limiting.LimitFlowType, args ...interface{})

EnableLimiting 启用限流算法 当是LIMIT_FLOW_COUNTER 第一个参数是流量的总限制,第二个参数是窗口大小 当是LIMIT_FLOW_ROLLING_COUNTER 第一个参数是流量总限制,第二个子窗口个数,第三个是总窗口大小 当LIMIT_FLOW_LEAKY_BUCKET 第一个是流量总大小,第二个参数是流出速度 个/毫秒 当LIMIT_FLOW_TOKEN_BUCKET 第一个参数是流入速度 个/毫秒

func Get

func Get(rootPath string, fun context.HandlerFunc)

Get 请求

func Head(rootPath string, fun context.HandlerFunc)

Head 请求

func LoadHTMLFiles

func LoadHTMLFiles(files ...string)

LoadHTMLFiles

func LoadHTMLGlob

func LoadHTMLGlob(pattern string)

LoadHTMLGlob

func Options

func Options(rootPath string, fun context.HandlerFunc)

Options 请求

func Patch

func Patch(rootPath string, fun context.HandlerFunc)

Patch 请求

func Post

func Post(rootPath string, fun context.HandlerFunc)

Post 请求

func Put

func Put(rootPath string, fun context.HandlerFunc)

Put 请求

func RegisterController

func RegisterController(controller interface{}, mapMethods ...string)

RegisterController 注册控制器

func Run

func Run(addr ...string)

Run 启动

func RunTLS added in v0.0.21

func RunTLS(certFile, keyFile string, addr ...string)

Run 启动

func SetFuncMap

func SetFuncMap(funcMap template.FuncMap)

SetFuncMap

func Static

func Static(relativePath, root string)

Static 静态目录

func StaticFile

func StaticFile(relativePath, filePath string)

StaticFile 静态文件

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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