Exp: Make eveything listable

This commit is contained in:
Fangliding
2026-02-02 01:26:01 +08:00
parent 37efc4237a
commit e9a2d26c07
18 changed files with 282 additions and 268 deletions
+6 -7
View File
@@ -1,19 +1,18 @@
package conf
import (
"google.golang.org/protobuf/proto"
"github.com/xtls/xray-core/app/observatory"
"github.com/xtls/xray-core/app/observatory/burst"
"github.com/xtls/xray-core/common/errors"
"github.com/xtls/xray-core/infra/conf/cfgcommon/types"
"google.golang.org/protobuf/proto"
)
type ObservatoryConfig struct {
SubjectSelector []string `json:"subjectSelector"`
ProbeURL string `json:"probeURL"`
ProbeInterval types.Duration `json:"probeInterval"`
EnableConcurrency bool `json:"enableConcurrency"`
SubjectSelector types.Listable[string] `json:"subjectSelector"`
ProbeURL string `json:"probeURL"`
ProbeInterval types.Duration `json:"probeInterval"`
EnableConcurrency bool `json:"enableConcurrency"`
}
func (o *ObservatoryConfig) Build() (proto.Message, error) {
@@ -21,7 +20,7 @@ func (o *ObservatoryConfig) Build() (proto.Message, error) {
}
type BurstObservatoryConfig struct {
SubjectSelector []string `json:"subjectSelector"`
SubjectSelector types.Listable[string] `json:"subjectSelector"`
// health check settings
HealthCheck *healthCheckSettings `json:"pingConfig,omitempty"`
}