Skip to content
Snippets Groups Projects
initPrometheus.gotmpl 724 B
Newer Older
// Code generated by go-swagger with a alpe-api template; DO NOT EDIT.

package {{.Package}}
{{ $package := .Package }}

import (
  {{ range $key, $value := .Imports }}{{ $key }} {{ printf "%q" $value }}
  {{ end }}
)

func (o *{{ pascalize .Name }}API) PrometheusInstrumentHandlers() {
    o.Init()
    {{range .Operations}}
    {{.ReceiverName}}.handlers[{{ printf "%q" (upper .Method) }}][{{ if eq .Path "/" }}""{{ else }}{{ printf "%q" (cleanPath .Path) }}{{ end }}] = {{if ne .Package $package}}{{.Package}}.{{end}}{{ pascalize .Name }}InstrumentHandler(
        {{.ReceiverName}}.handlers[{{ printf "%q" (upper .Method) }}][{{ if eq .Path "/" }}""{{ else }}{{ printf "%q" (cleanPath .Path) }}{{ end }}])
    {{end}}
}