1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-07-07 22:04:30 -04:00
v2fly/infra/conf/observatory.go

19 lines
576 B
Go
Raw Normal View History

2021-04-08 17:20:30 -04:00
package conf
import (
"github.com/golang/protobuf/proto"
2021-07-01 14:02:27 -04:00
2021-04-08 17:20:30 -04:00
"github.com/v2fly/v2ray-core/v4/app/observatory"
2021-08-09 23:08:45 -04:00
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/duration"
2021-04-08 17:20:30 -04:00
)
type ObservatoryConfig struct {
2021-06-30 14:33:37 -04:00
SubjectSelector []string `json:"subjectSelector"`
ProbeURL string `json:"probeURL"`
ProbeInterval duration.Duration `json:"ProbeInterval"`
2021-04-08 17:20:30 -04:00
}
func (o *ObservatoryConfig) Build() (proto.Message, error) {
2021-06-30 14:33:37 -04:00
return &observatory.Config{SubjectSelector: o.SubjectSelector, ProbeUrl: o.ProbeURL, ProbeInterval: int64(o.ProbeInterval)}, nil
2021-04-08 17:20:30 -04:00
}