Documentation
¶
Overview ¶
Package gintestpage: HTTP test hosting with HTML page serving and development Provides lightweight HTTP hosting using Gin framework when testing pages Enables dynamic page registration and serving with memory-based storage Supports rapid prototyping and testing of HTML content using URL generation
gintestpage: 用于 HTML 页面服务和开发的 HTTP 测试服务器 使用 Gin 框架提供轻量级 HTTP 服务器用于页面测试 启用动态页面注册和基于内存存储的服务 支持 HTML 内容的快速原型制作和测试,具有 URL 生成功能
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides HTTP test server functionality with dynamic page hosting Manages temporary HTTP server and in-memory page storage for testing Enables rapid webpage content serving with unique URL generation
Service 提供带有动态页面托管的 HTTP 测试服务器功能 管理临时 HTTP 服务器和内存中的页面存储以供测试 启用具有唯一 URL 生成的快速网页内容服务
func NewService ¶
func NewService() *Service
NewService creates HTTP test server instance with Gin framework integration Initializes temporary HTTP server with dynamic page routing capabilities Returns configured service ready for webpage hosting and URL generation
NewService 创建与 Gin 框架集成的 HTTP 测试服务器实例 初始化具有动态页面路由功能的临时 HTTP 服务器 返回准备好进行网页托管和 URL 生成的配置服务
func (*Service) Close ¶
func (service *Service) Close()
Close terminates HTTP test server and releases resources Stops the temporary HTTP server and cleans up network resources Should be called when testing is complete
Close 终止 HTTP 测试服务器并释放资源 停止临时 HTTP 服务器并清理网络资源 应在测试完成时调用
func (*Service) GetLink ¶
GetLink generates complete URL for specified path on test server Constructs full HTTP URL using test server base and provided path Path must not contain slash characters for security
GetLink 为测试服务器上的指定路径生成完整 URL 使用测试服务器基础地址和提供的路径构建完整 HTTP URL 出于安全考虑,路径不能包含斜杠字符
func (*Service) SetPage ¶
SetPage registers HTML page content at specified path and returns access URL Stores page content in memory and generates accessible URL for the content Path must not contain slash characters for security
SetPage 在指定路径注册 HTML 页面内容并返回访问 URL 将页面内容存储在内存中并为内容生成可访问的 URL 出于安全考虑,路径不能包含斜杠字符