Alerting: conversion API structure (#100258)

This commit is contained in:
Alexander Akhmetov
2025-02-12 08:13:21 +01:00
committed by GitHub
parent 9b37e9249a
commit 9593e51da7
18 changed files with 1333 additions and 8 deletions
@@ -20,6 +20,14 @@ type {{classname}} interface { {{#operation}}
}
{{#operations}}{{#operation}}
{{#vendorExtensions.x-raw-request}}
func (f *{{classname}}Handler) {{nickname}}(ctx *contextmodel.ReqContext) response.Response { {{#hasPathParams}}
// Parse Path Parameters{{/hasPathParams}}{{#pathParams}}
{{paramName}}Param := web.Params(ctx.Req)[":{{baseName}}"]{{/pathParams}}
return f.handle{{nickname}}(ctx{{#pathParams}}, {{paramName}}Param{{/pathParams}})
}
{{/vendorExtensions.x-raw-request}}
{{^vendorExtensions.x-raw-request}}
func (f *{{classname}}Handler) {{nickname}}(ctx *contextmodel.ReqContext) response.Response { {{#hasPathParams}}
// Parse Path Parameters{{/hasPathParams}}{{#pathParams}}
{{paramName}}Param := web.Params(ctx.Req)[":{{baseName}}"]{{/pathParams}}
@@ -31,6 +39,7 @@ func (f *{{classname}}Handler) {{nickname}}(ctx *contextmodel.ReqContext) respon
}
{{/bodyParams}}return f.handle{{nickname}}(ctx{{#bodyParams}}, conf{{/bodyParams}}{{#pathParams}}, {{paramName}}Param{{/pathParams}})
}
{{/vendorExtensions.x-raw-request}}
{{/operation}}{{/operations}}
func (api *API) Register{{classname}}Endpoints(srv {{classname}}, m *metrics.API) {