Documentation ¶
Index ¶
- func ExtServices(c *gin.Context) *extdeps.ExtServices
- func ExtServicesMiddleware(es *extdeps.ExternalServicesBuilder) gin.HandlerFunc
- func ObsMiddleware() gin.HandlerFunc
- func RecoveryWithObs(ins *obs.Insighter) gin.HandlerFunc
- type ReportingRouterGroup
- func (r *ReportingRouterGroup) Any(route string, hfs ...gin.HandlerFunc) gin.IRoutes
- func (r *ReportingRouterGroup) DELETE(route string, hfs ...gin.HandlerFunc) gin.IRoutes
- func (r *ReportingRouterGroup) GET(route string, hfs ...gin.HandlerFunc) gin.IRoutes
- func (r *ReportingRouterGroup) Group(route string, hfs ...gin.HandlerFunc) *gin.RouterGroup
- func (r *ReportingRouterGroup) HEAD(route string, hfs ...gin.HandlerFunc) gin.IRoutes
- func (r *ReportingRouterGroup) Handle(method string, route string, hfs ...gin.HandlerFunc) gin.IRoutes
- func (r *ReportingRouterGroup) Match(methods []string, relativePaths string, hfs ...gin.HandlerFunc) gin.IRoutes
- func (r *ReportingRouterGroup) OPTIONS(route string, hfs ...gin.HandlerFunc) gin.IRoutes
- func (r *ReportingRouterGroup) PATCH(route string, hfs ...gin.HandlerFunc) gin.IRoutes
- func (r *ReportingRouterGroup) POST(route string, hfs ...gin.HandlerFunc) gin.IRoutes
- func (r *ReportingRouterGroup) PUT(route string, hfs ...gin.HandlerFunc) gin.IRoutes
- func (r *ReportingRouterGroup) Static(relativePath string, root string) gin.IRoutes
- func (r *ReportingRouterGroup) StaticFS(relativePath string, fs http.FileSystem) gin.IRoutes
- func (r *ReportingRouterGroup) StaticFile(relativePath string, filePath string) gin.IRoutes
- func (r *ReportingRouterGroup) StaticFileFS(relativePath string, filePath string, fs http.FileSystem) gin.IRoutes
- func (r *ReportingRouterGroup) Use(hfs ...gin.HandlerFunc) gin.IRoutes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtServices ¶
func ExtServices(c *gin.Context) *extdeps.ExtServices
ExtServices returns the ExtServices instance stored in the gin.Context
func ExtServicesMiddleware ¶
func ExtServicesMiddleware(es *extdeps.ExternalServicesBuilder) gin.HandlerFunc
ExtServicesMiddleware creates a new ExternalServices (or external dependencies) for the incoming request, and stores it in the gin context
func ObsMiddleware ¶
func ObsMiddleware() gin.HandlerFunc
ObsMiddleware creates a middlewware that attaches the ExternalServices instance and insighters instance with some fields already set, like the method and path for the request, the client ip for the logs, the request time as well as a unique request ID. It will also report the duration and size of the response.
func RecoveryWithObs ¶
func RecoveryWithObs(ins *obs.Insighter) gin.HandlerFunc
RecoveryWithObs returns a middleware for a given writer that recovers from any panics and writes a 500 if there was one.
Types ¶
type ReportingRouterGroup ¶
type ReportingRouterGroup struct {
// contains filtered or unexported fields
}
func NewGroup ¶
func NewGroup(r *gin.RouterGroup, ins *obs.Insighter) *ReportingRouterGroup
func (*ReportingRouterGroup) Any ¶
func (r *ReportingRouterGroup) Any(route string, hfs ...gin.HandlerFunc) gin.IRoutes
func (*ReportingRouterGroup) DELETE ¶
func (r *ReportingRouterGroup) DELETE(route string, hfs ...gin.HandlerFunc) gin.IRoutes
func (*ReportingRouterGroup) GET ¶
func (r *ReportingRouterGroup) GET(route string, hfs ...gin.HandlerFunc) gin.IRoutes
func (*ReportingRouterGroup) Group ¶
func (r *ReportingRouterGroup) Group(route string, hfs ...gin.HandlerFunc) *gin.RouterGroup
func (*ReportingRouterGroup) HEAD ¶
func (r *ReportingRouterGroup) HEAD(route string, hfs ...gin.HandlerFunc) gin.IRoutes
func (*ReportingRouterGroup) Handle ¶
func (r *ReportingRouterGroup) Handle(method string, route string, hfs ...gin.HandlerFunc) gin.IRoutes
func (*ReportingRouterGroup) Match ¶
func (r *ReportingRouterGroup) Match(methods []string, relativePaths string, hfs ...gin.HandlerFunc) gin.IRoutes
func (*ReportingRouterGroup) OPTIONS ¶
func (r *ReportingRouterGroup) OPTIONS(route string, hfs ...gin.HandlerFunc) gin.IRoutes
func (*ReportingRouterGroup) PATCH ¶
func (r *ReportingRouterGroup) PATCH(route string, hfs ...gin.HandlerFunc) gin.IRoutes
func (*ReportingRouterGroup) POST ¶
func (r *ReportingRouterGroup) POST(route string, hfs ...gin.HandlerFunc) gin.IRoutes
func (*ReportingRouterGroup) PUT ¶
func (r *ReportingRouterGroup) PUT(route string, hfs ...gin.HandlerFunc) gin.IRoutes
func (*ReportingRouterGroup) Static ¶
func (r *ReportingRouterGroup) Static(relativePath string, root string) gin.IRoutes
func (*ReportingRouterGroup) StaticFS ¶
func (r *ReportingRouterGroup) StaticFS(relativePath string, fs http.FileSystem) gin.IRoutes
func (*ReportingRouterGroup) StaticFile ¶
func (r *ReportingRouterGroup) StaticFile(relativePath string, filePath string) gin.IRoutes
func (*ReportingRouterGroup) StaticFileFS ¶
func (r *ReportingRouterGroup) StaticFileFS(relativePath string, filePath string, fs http.FileSystem) gin.IRoutes
func (*ReportingRouterGroup) Use ¶
func (r *ReportingRouterGroup) Use(hfs ...gin.HandlerFunc) gin.IRoutes
Click to show internal directories.
Click to hide internal directories.