lolly/internal/server/internal.go
xfy911 05f434d5e5 docs(server): add package comments for server module
- Add package documentation for router, internal, lifecycle, and middleware_builder files
- Include author attribution (xfy)
2026-06-03 15:28:53 +08:00

32 lines
920 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Package server 提供 HTTP 服务器的核心实现,支持单服务器、虚拟主机和多服务器三种运行模式。
//
// 包含服务器内部工具函数,用于处理服务器运行时逻辑。
//
// 作者xfy
package server
import (
"github.com/valyala/fasthttp"
"rua.plus/lolly/internal/utils"
)
const (
// InternalRedirectKey 内部重定向标记
InternalRedirectKey = utils.InternalRedirectKey
)
// SetInternalRedirect 标记请求为内部重定向
func SetInternalRedirect(ctx *fasthttp.RequestCtx, targetPath string) {
utils.SetInternalRedirect(ctx, targetPath)
}
// IsInternalRedirect 检查是否为内部重定向
func IsInternalRedirect(ctx *fasthttp.RequestCtx) bool {
return utils.IsInternalRedirect(ctx)
}
// GetInternalRedirectPath 获取内部重定向目标路径
func GetInternalRedirectPath(ctx *fasthttp.RequestCtx) string {
return utils.GetInternalRedirectPath(ctx)
}