Documentation
¶
Index ¶
- type HttpServer
- func (server *HttpServer) Address() string
- func (server *HttpServer) LogRegisteredRoutes()
- func (server *HttpServer) Name() string
- func (server *HttpServer) RegisterGlobalMiddleware(handlers ...gin.HandlerFunc) error
- func (server *HttpServer) RegisterRoute(path, method string, handlers ...gin.HandlerFunc) error
- func (server *HttpServer) RegisterRouteGroup(group RoutingGroup) error
- func (server *HttpServer) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (server *HttpServer) Start() error
- type RoutingGroup
- type StaticRoute
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HttpServer ¶
type HttpServer struct {
// contains filtered or unexported fields
}
func NewHttpServer ¶
func NewHttpServer(ctx context.Context, name, addr string, log zerolog.Logger, middlewares ...gin.HandlerFunc) (server *HttpServer, err error)
func (*HttpServer) Address ¶ added in v0.0.21
func (server *HttpServer) Address() string
func (*HttpServer) LogRegisteredRoutes ¶ added in v0.0.24
func (server *HttpServer) LogRegisteredRoutes()
func (*HttpServer) RegisterGlobalMiddleware ¶
func (server *HttpServer) RegisterGlobalMiddleware(handlers ...gin.HandlerFunc) error
func (*HttpServer) RegisterRoute ¶
func (server *HttpServer) RegisterRoute(path, method string, handlers ...gin.HandlerFunc) error
func (*HttpServer) RegisterRouteGroup ¶
func (server *HttpServer) RegisterRouteGroup(group RoutingGroup) error
func (*HttpServer) ServeHTTP ¶
func (server *HttpServer) ServeHTTP(w http.ResponseWriter, req *http.Request)
func (*HttpServer) Start ¶
func (server *HttpServer) Start() error
type RoutingGroup ¶
type RoutingGroup struct { Base string Middleware []gin.HandlerFunc Routes map[string]map[string][]gin.HandlerFunc // path:method:handlers Groups []RoutingGroup Static []StaticRoute }
func (RoutingGroup) Register ¶ added in v0.0.23
func (rg RoutingGroup) Register(registrator grouper) (err error)
type StaticRoute ¶ added in v0.0.25
type StaticRoute struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.