Documentation
¶
Overview ¶
Package echo 提供 Echo Web 框架自动配置。
Package echo 提供 Echo Web 框架自动配置。
Index ¶
- Constants
- func GetServer(container core.Container) (*echo.Echo, error)
- func TracingMiddleware(tracer *tracing.Tracer) echo.MiddlewareFunc
- type EchoAutoConfiguration
- func (c *EchoAutoConfiguration) Configure(ctx boot.ApplicationContext) error
- func (c *EchoAutoConfiguration) Dependencies() []string
- func (c *EchoAutoConfiguration) GetCondition() condition.Condition
- func (c *EchoAutoConfiguration) Name() string
- func (c *EchoAutoConfiguration) Start(ctx boot.ApplicationContext) error
- func (c *EchoAutoConfiguration) Stop(ctx boot.ApplicationContext) error
- type EchoConfig
- type EchoEndpointRegistry
Constants ¶
View Source
const ( EchoEnabled = "echo.enabled" ConditionTrue = "true" )
配置常量。
View Source
const Doc = "Echo Web 框架自动配置 - 当 echo.enabled=true 时自动生效"
Doc 包文档说明。
Variables ¶
This section is empty.
Functions ¶
func TracingMiddleware ¶
func TracingMiddleware(tracer *tracing.Tracer) echo.MiddlewareFunc
TracingMiddleware Echo 框架的分布式链路追踪中间件。
自动从请求头提取追踪上下文,创建 Span 并记录请求信息。
Types ¶
type EchoAutoConfiguration ¶
type EchoAutoConfiguration struct {
// contains filtered or unexported fields
}
EchoAutoConfiguration Echo Web 框架自动配置类。
func (*EchoAutoConfiguration) Configure ¶
func (c *EchoAutoConfiguration) Configure(ctx boot.ApplicationContext) error
Configure 配置 Echo Web 服务器。
func (*EchoAutoConfiguration) Dependencies ¶
func (c *EchoAutoConfiguration) Dependencies() []string
Dependencies 返回依赖的其他启动器名称。
func (*EchoAutoConfiguration) GetCondition ¶
func (c *EchoAutoConfiguration) GetCondition() condition.Condition
GetCondition 返回启动器条件。
func (*EchoAutoConfiguration) Start ¶
func (c *EchoAutoConfiguration) Start(ctx boot.ApplicationContext) error
Start 启动 Echo Web 服务器。
func (*EchoAutoConfiguration) Stop ¶
func (c *EchoAutoConfiguration) Stop(ctx boot.ApplicationContext) error
Stop 停止 Echo Web 服务器。
type EchoConfig ¶
type EchoConfig struct {
Enabled bool `json:"enabled" mapstructure:"enabled"`
Host string `json:"host" mapstructure:"host"`
Port int `json:"port" mapstructure:"port"`
HideBanner bool `json:"hide_banner" mapstructure:"hide_banner"`
HidePort bool `json:"hide_port" mapstructure:"hide_port"`
EnableRecover bool `json:"enable_recover" mapstructure:"enable_recover"`
EnableLogger bool `json:"enable_logger" mapstructure:"enable_logger"`
EnableCORS bool `json:"enable_cors" mapstructure:"enable_cors"`
}
EchoConfig Echo Web 服务器配置。
type EchoEndpointRegistry ¶
type EchoEndpointRegistry struct {
// contains filtered or unexported fields
}
EchoEndpointRegistry Echo 框架的 HttpEndpointRegistry 实现
该实现将 Actuator 的标准 http.Handler 适配为 Echo 的 HandlerFunc, 并注册到 Echo 引擎中。
func NewEchoEndpointRegistry ¶
func NewEchoEndpointRegistry(engine *echo.Echo) *EchoEndpointRegistry
NewEchoEndpointRegistry 创建 Echo 端点注册表
func (*EchoEndpointRegistry) HasEndpoint ¶
func (r *EchoEndpointRegistry) HasEndpoint(path string) bool
HasEndpoint 检查是否已注册指定路径的端点
func (*EchoEndpointRegistry) RegisterEndpoint ¶
func (r *EchoEndpointRegistry) RegisterEndpoint(method, path string, handler http.Handler)
RegisterEndpoint 注册单个端点
func (*EchoEndpointRegistry) RegisterEndpoints ¶
func (r *EchoEndpointRegistry) RegisterEndpoints(endpoints []actuator.EndpointConfig)
RegisterEndpoints 批量注册端点
Click to show internal directories.
Click to hide internal directories.