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