Help us shape the future of Go! Take the 2026 Go Developer Survey

preset

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

README

HTTPServer Preset 包

httpserver/preset 提供官方推荐的 HTTP server 装配方式,适合希望快速得到一致默认链路的项目。

设计约束

  • 只做装配,不重复实现中间件
  • 不自动注册 metrics、swagger、pprof
  • 仍保留 srv.Use(...) 和 srv.Group(...) 的扩展空间

快速开始

srv := preset.NewProductionServer(cfg)

Documentation

Overview

Package preset 提供官方推荐的 HTTP server 默认装配。

该包只负责组合 httpserver core 与官方中间件,不重复实现底层能力。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDevelopmentServer

func NewDevelopmentServer(config *httpserver.Config, opts ...httpserver.Option) *httpserver.Server

NewDevelopmentServer 创建适合开发环境的默认服务器。

func NewProductionServer

func NewProductionServer(config *httpserver.Config, opts ...httpserver.Option) *httpserver.Server

NewProductionServer 创建带官方生产默认链路的服务器。

Types

This section is empty.

Jump to

Keyboard shortcuts

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