Xray-core/infra/conf/metrics.go

21 lines
352 B
Go

package conf
import (
"github.com/xtls/xray-core/app/metrics"
"github.com/xtls/xray-core/common/errors"
)
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.")
}
return &metrics.Config{
Tag: c.Tag,
}, nil
}