metrics.go 307 B

12345678910111213141516171819
  1. package conf
  2. import (
  3. "github.com/xtls/xray-core/app/metrics"
  4. )
  5. type MetricsConfig struct {
  6. Tag string `json:"tag"`
  7. }
  8. func (c *MetricsConfig) Build() (*metrics.Config, error) {
  9. if c.Tag == "" {
  10. return nil, newError("metrics tag can't be empty.")
  11. }
  12. return &metrics.Config{
  13. Tag: c.Tag,
  14. }, nil
  15. }