Documentation
¶
Index ¶
- func NewServer(opts ...ServerOption) *khttp.Server
- type Registrar
- type ServerOption
- func WithCORS(c *conf.CORS) ServerOption
- func WithConfig(c *conf.Server_HTTP) ServerOption
- func WithHealthCheck(h *health.Handler) ServerOption
- func WithLogger(l log.Logger) ServerOption
- func WithMetrics(m *telemetry.Metrics) ServerOption
- func WithMiddleware(mw ...middleware.Middleware) ServerOption
- func WithServices(registrars ...Registrar) ServerOption
- func WithSwagger(specData []byte, opts ...swagger.Option) ServerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewServer ¶
func NewServer(opts ...ServerOption) *khttp.Server
Types ¶
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) 路由。
Click to show internal directories.
Click to hide internal directories.