Invalid config check

This commit is contained in:
世界
2022-07-03 01:57:04 +08:00
parent 6eae8e361f
commit 30444057bd
16 changed files with 276 additions and 162 deletions

View File

@@ -1,5 +1,7 @@
package option
import "github.com/sagernet/sing/common"
type Options struct {
Log *LogOption `json:"log"`
Inbounds []Inbound `json:"inbounds,omitempty"`
@@ -7,6 +9,13 @@ type Options struct {
Route *RouteOptions `json:"route,omitempty"`
}
func (o Options) Equals(other Options) bool {
return common.ComparablePtrEquals(o.Log, other.Log) &&
common.SliceEquals(o.Inbounds, other.Inbounds) &&
common.ComparableSliceEquals(o.Outbounds, other.Outbounds) &&
common.PtrEquals(o.Route, other.Route)
}
type LogOption struct {
Disabled bool `json:"disabled,omitempty"`
Level string `json:"level,omitempty"`