Documentation
¶
Index ¶
- type Server
- type ServerConfig
- type ServerEntity
- func (s *ServerEntity) Engine() *http.Server
- func (s *ServerEntity) GinEngine() *gin.Engine
- func (s *ServerEntity) Group(relativePath string, handlers ...gin.HandlerFunc) *gin.RouterGroup
- func (s *ServerEntity) Shutdown() error
- func (s *ServerEntity) Start() (err error)
- func (s *ServerEntity) Use(middlewares ...gin.HandlerFunc)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server interface {
Start() error
Use(...gin.HandlerFunc)
Engine() *http.Server
GinEngine() *gin.Engine
Group(relativePath string, handlers ...gin.HandlerFunc) *gin.RouterGroup
Shutdown() error
}
func New ¶
func New(conf *ServerConfig) Server
type ServerConfig ¶
type ServerConfig struct {
ServiceName string // Service Name for Trace
Addr string
Mode string
Trace bool
// TraceFilter gintrace.Filter
Logger *logger.Logger // Custom logger (micro/logger)
EnableLogger bool // Enable/Disable access logging
// Timeouts
ReadTimeout time.Duration
WriteTimeout time.Duration
IdleTimeout time.Duration
// ObservabilitySkipPaths 跳过可观测性记录(Metrics & Trace)的路径列表
// 默认为 /healthz, /metrics, /favicon.ico。用户配置将与默认值合并。
ObservabilitySkipPaths []string
}
type ServerEntity ¶
type ServerEntity struct {
*ServerConfig
// contains filtered or unexported fields
}
func (*ServerEntity) Engine ¶
func (s *ServerEntity) Engine() *http.Server
func (*ServerEntity) GinEngine ¶
func (s *ServerEntity) GinEngine() *gin.Engine
func (*ServerEntity) Group ¶
func (s *ServerEntity) Group(relativePath string, handlers ...gin.HandlerFunc) *gin.RouterGroup
func (*ServerEntity) Shutdown ¶
func (s *ServerEntity) Shutdown() error
func (*ServerEntity) Start ¶
func (s *ServerEntity) Start() (err error)
func (*ServerEntity) Use ¶
func (s *ServerEntity) Use(middlewares ...gin.HandlerFunc)
Click to show internal directories.
Click to hide internal directories.