Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server interface {
Start(context.Context) error
Serve(context.Context, net.Listener) error
Close() error
Use(...gin.HandlerFunc)
HTTPServer() *http.Server
GinEngine() *gin.Engine
Group(relativePath string, handlers ...gin.HandlerFunc) *gin.RouterGroup
Shutdown(context.Context) error
}
func New ¶
func New(conf *ServerConfig) Server
type ServerConfig ¶
type ServerConfig struct {
ServiceName string
Addr string
Listener net.Listener
Mode string
Trace bool
Logger *logger.Logger
EnableLogger bool
ReadTimeout time.Duration
ReadHeaderTimeout time.Duration
WriteTimeout time.Duration
IdleTimeout time.Duration
ShutdownTimeout time.Duration
ObservabilitySkipPaths []string
MetricsRegisterer prometheus.Registerer
DisableMetrics bool
DisableHealthEndpoint bool
HealthPath string
HealthHandler http.Handler
}
Click to show internal directories.
Click to hide internal directories.