stdlib

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package stdlib 提供基于标准库 net/http 的引擎实现。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

type Factory struct{}

Factory 标准库引擎工厂。

func (*Factory) CreateRouter

func (f *Factory) CreateRouter() (core.Router, error)

CreateRouter 创建路由器。

func (*Factory) CreateServer

func (f *Factory) CreateServer(opts ...engine.ServerOption) (core.Server, error)

CreateServer 创建服务器。

func (*Factory) Type

func (f *Factory) Type() engine.Type

Type 返回引擎类型。

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server 标准库服务器实现。

func NewServer

func NewServer(opts ...engine.ServerOption) *Server

NewServer 创建新的 HTTP 服务器。

func (*Server) SetHandler

func (s *Server) SetHandler(handler http.Handler)

SetHandler 设置处理器。

func (*Server) Start

func (s *Server) Start() error

Start 启动 HTTP 服务器。

func (*Server) Stop

func (s *Server) Stop(ctx context.Context) error

Stop 优雅地停止服务器。

func (*Server) Use

func (s *Server) Use(middleware func(http.Handler) http.Handler)

Use 注册中间件。

Jump to

Keyboard shortcuts

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