1
0
mirror of https://github.com/XTLS/Xray-core.git synced 2025-01-05 03:39:47 +00:00
Xray-core/infra/conf/metrics.go

21 lines
352 B
Go
Raw Normal View History

2022-03-25 03:24:23 +00:00
package conf
import (
"github.com/xtls/xray-core/app/metrics"
"github.com/xtls/xray-core/common/errors"
2022-03-25 03:24:23 +00:00
)
type MetricsConfig struct {
Tag string `json:"tag"`
}
func (c *MetricsConfig) Build() (*metrics.Config, error) {
if c.Tag == "" {
return nil, errors.New("metrics tag can't be empty.")
2022-03-25 03:24:23 +00:00
}
return &metrics.Config{
Tag: c.Tag,
}, nil
}