github.com/moqsien/xraycore@v1.8.5/infra/conf/observatory.go (about)

     1  package conf
     2  
     3  import (
     4  	"github.com/moqsien/xraycore/app/observatory"
     5  	"github.com/moqsien/xraycore/infra/conf/cfgcommon/duration"
     6  	"google.golang.org/protobuf/proto"
     7  )
     8  
     9  type ObservatoryConfig struct {
    10  	SubjectSelector   []string          `json:"subjectSelector"`
    11  	ProbeURL          string            `json:"probeURL"`
    12  	ProbeInterval     duration.Duration `json:"probeInterval"`
    13  	EnableConcurrency bool              `json:"enableConcurrency"`
    14  }
    15  
    16  func (o *ObservatoryConfig) Build() (proto.Message, error) {
    17  	return &observatory.Config{SubjectSelector: o.SubjectSelector, ProbeUrl: o.ProbeURL, ProbeInterval: int64(o.ProbeInterval), EnableConcurrency: o.EnableConcurrency}, nil
    18  }