observatory.go 576 B

123456789101112131415161718
  1. package conf
  2. import (
  3. "github.com/golang/protobuf/proto"
  4. "github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/duration"
  5. "github.com/v2fly/v2ray-core/v4/app/observatory"
  6. )
  7. type ObservatoryConfig struct {
  8. SubjectSelector []string `json:"subjectSelector"`
  9. ProbeURL string `json:"probeURL"`
  10. ProbeInterval duration.Duration `json:"ProbeInterval"`
  11. }
  12. func (o *ObservatoryConfig) Build() (proto.Message, error) {
  13. return &observatory.Config{SubjectSelector: o.SubjectSelector, ProbeUrl: o.ProbeURL, ProbeInterval: int64(o.ProbeInterval)}, nil
  14. }