Documentation
¶
Overview ¶
Package host 提供了限定访问域名的中间件
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Host ¶
type Host struct {
// contains filtered or unexported fields
}
Host 限定域名的中间件
func New ¶
New 声明一个限定域名的中间件
若请求的域名不允许,会返回 404 错误。 若 domain 为空,则任何请求都将返回 404。
仅会将域名与 domains 进行比较,端口与协议都将不参写比较。
func (*Host) Add ¶
Add 添加新的域名
domain 可以是泛域名,比如 *.example.com,但不能是 s1.*.example.com。
NOTE: 重复的值不会重复添加。
func (*Host) Middleware ¶
Middleware 将当前中间件应用于 next
func (*Host) MiddlewareFunc ¶
MiddlewareFunc 将当前中间件应用于 next
Click to show internal directories.
Click to hide internal directories.