Documentation
¶
Index ¶
- Variables
- type Group
- func (T *Group) Close() error
- func (T *Group) GetServer(laddr string) (*Server, bool)
- func (T *Group) LoadConfigFile(p string) (ok bool, err error)
- func (T *Group) SetServer(laddr string, srv *Server) error
- func (T *Group) SiteMan() *vweb.SiteMan
- func (T *Group) Start() error
- func (T *Group) UpdateConfig(conf *config.Config) error
- type Server
- func (T *Server) Close() error
- func (T *Server) ConfigConn(cc *config.Conn) error
- func (T *Server) ConfigServer(cs *config.Server) error
- func (T *Server) IsRunning() bool
- func (T *Server) ListenAndServe() error
- func (T *Server) Serve(l net.Listener) error
- func (T *Server) Shutdown(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ServerContextKey = &contextKey{"Server"}
View Source
var Version = "Server/v3"
Functions ¶
This section is empty.
Types ¶
type Group ¶
type Group struct {
ErrorLog *log.Logger // 错误日志文件
Module func(name string) (vweb.DynamicTemplater, error) // 支持更动态文件类型
CertManager *autocert.Manager // 自动申请证书 Let's Encrypt
// contains filtered or unexported fields
}
func (*Group) GetServer ¶
GetServer 读取一个服务器
laddr string 监听地址 *Server 服务器 bool 如果存在服务器, 返回true。否则返回false
func (*Group) LoadConfigFile ¶
LoadConfigFile 挂载本地配置文件。
p string 文件路径 ok bool true配置文件被修改过, false没有变动 err error 错误
type Server ¶
type Server struct {
*http.Server // http服务器
Addr string
// contains filtered or unexported fields
}
Server 封装 http.Server,支持自定义 TCP 选项、TLS 与并发安全状态。
func (*Server) ConfigConn ¶
ConfigConn 配置连接级 TCP 选项(KeepAlive、NoDelay、缓冲区、Deadline 等)。
func (*Server) ConfigServer ¶
ConfigServer 配置服务器参数(超时、TLS、KeepAlive 等)。
func (*Server) ListenAndServe ¶
ListenAndServe 在 T.Addr 上监听并服务。
Click to show internal directories.
Click to hide internal directories.