add mux config
This commit is contained in:
22
handler/metrics/metadata.go
Normal file
22
handler/metrics/metadata.go
Normal file
@ -0,0 +1,22 @@
|
||||
package file
|
||||
|
||||
import (
|
||||
mdata "github.com/go-gost/core/metadata"
|
||||
mdutil "github.com/go-gost/core/metadata/util"
|
||||
)
|
||||
|
||||
const (
|
||||
DefaultPath = "/metrics"
|
||||
)
|
||||
|
||||
type metadata struct {
|
||||
path string
|
||||
}
|
||||
|
||||
func (h *metricsHandler) parseMetadata(md mdata.Metadata) (err error) {
|
||||
h.md.path = mdutil.GetString(md, "metrics.path", "path")
|
||||
if h.md.path == "" {
|
||||
h.md.path = DefaultPath
|
||||
}
|
||||
return
|
||||
}
|
Reference in New Issue
Block a user