Documentation
¶
Index ¶
- func EndTx(tx *newrelic.Transaction)
- func GetNRApp() *newrelic.Application
- func RegisterNewrelic() *newrelic.Application
- func RegisterSwaggerDocs(serverContext *ServerContext)
- func StartTx(name string) *newrelic.Transaction
- func WrapNR(pattern string, handler func(http.ResponseWriter, *http.Request)) (string, func(http.ResponseWriter, *http.Request))
- type ServerContext
- type StructuredLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterNewrelic ¶
func RegisterNewrelic() *newrelic.Application
register newrelic with the service name
func RegisterSwaggerDocs ¶
func RegisterSwaggerDocs(serverContext *ServerContext)
Types ¶
type ServerContext ¶
type ServerContext struct { Router *chi.Mux NRApp *newrelic.Application }
ServerContext maintain service level state
func (*ServerContext) Mount ¶
func (ctx *ServerContext) Mount(path string, handler http.Handler)
Mount mounts sub router with a path
func (*ServerContext) Register ¶
func (ctx *ServerContext) Register(path string, handle func(http.ResponseWriter, *http.Request), method string)
Register registers handler with a path
func (*ServerContext) StartServer ¶
func (ctx *ServerContext) StartServer(address string)
StartServer serves on address
type StructuredLogger ¶
StructuredLogger holds instance of logrus
Click to show internal directories.
Click to hide internal directories.