Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConnHandlerFunc ¶
type ConnHandlerFunc func( ctx context.Context, conn *sql.DB, metricParams map[string]string, extraParams ...string, ) (any, error)
ConnHandlerFunc describes the signature all connection handler functions must have.
func QueryHandlerFunc ¶
func QueryHandlerFunc(query string) ConnHandlerFunc
QueryHandlerFunc returns a handler function that will execute the specified query with arguments, formatting result rows as JSON.
type CustomQueries ¶
CustomQueries stores user defined custom queries.
type HandlerFunc ¶
HandlerFunc describes the signature all metric handler functions must have.
func WithJSONResponse ¶
func WithJSONResponse(handler HandlerFunc) HandlerFunc
WithJSONResponse wraps a handler function, marshaling its response to a JSON object and returning it as string.
Click to show internal directories.
Click to hide internal directories.