Documentation ¶
Index ¶
Constants ¶
View Source
const ( ResourceTagName = "service-name" MethodTagName = "method" EndpointTagName = "endpoint" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Resource ¶
type Resource interface { // Register performs the same operation as the Router.Register, but registers the route using the provided // resourceName as the resource name that will be used as the tag in the recorded metric. Register(endpointName, method, path string, handler http.Handler, params ...wrouter.RouteParam) error // Get is a shorthand for Register(endpointName, http.MethodGet, handler, params...) Get(endpointName, path string, handler http.Handler, params ...wrouter.RouteParam) error // Head is a shorthand for Register(endpointName, http.MethodGet, handler, params...) Head(endpointName, path string, handler http.Handler, params ...wrouter.RouteParam) error // Post is a shorthand for Register(endpointName, http.MethodGet, handler, params...) Post(endpointName, path string, handler http.Handler, params ...wrouter.RouteParam) error // Put is a shorthand for Register(endpointName, http.MethodGet, handler, params...) Put(endpointName, path string, handler http.Handler, params ...wrouter.RouteParam) error // Patch is a shorthand for Register(endpointName, http.MethodGet, handler, params...) Patch(endpointName, path string, handler http.Handler, params ...wrouter.RouteParam) error // Delete is a shorthand for Register(endpointName, http.MethodGet, handler, params...) Delete(endpointName, path string, handler http.Handler, params ...wrouter.RouteParam) error }
Resource provides a way to register a collection of endpoints. All of the routes registered using Resource will be tagged with the "service-name" and "endpoint" metrics.
Click to show internal directories.
Click to hide internal directories.