http

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

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

Types

type Registrar

type Registrar func(*khttp.Server)

type ServerOption

type ServerOption func(*serverOptions)

func WithCORS

func WithCORS(c *conf.CORS) ServerOption

func WithConfig

func WithConfig(c *conf.Server_HTTP) ServerOption

func WithHealthCheck

func WithHealthCheck(h *health.Handler) ServerOption

WithHealthCheck 启用健康探针端点。 注册 GET /healthz (liveness) 和 GET /readyz (readiness) 路由。

func WithLogger

func WithLogger(l log.Logger) ServerOption

func WithMetrics

func WithMetrics(m *telemetry.Metrics) ServerOption

func WithMiddleware

func WithMiddleware(mw ...middleware.Middleware) ServerOption

func WithServices

func WithServices(registrars ...Registrar) ServerOption

func WithSwagger

func WithSwagger(specData []byte, opts ...swagger.Option) ServerOption

WithSwagger 启用 Swagger UI 文档端点。 注册 GET /docs/ (UI 页面) 和 GET /docs/openapi.yaml (原始 spec) 路由。

Jump to

Keyboard shortcuts

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