sing-box/option/config.go

24 lines
706 B
Go
Raw Normal View History

2022-07-02 06:07:50 +00:00
package option
2022-07-02 17:57:04 +00:00
import "github.com/sagernet/sing/common"
2022-07-02 06:07:50 +00:00
type Options struct {
2022-07-02 19:42:57 +00:00
Log *LogOption `json:"log,omitempty"`
2022-07-02 14:55:10 +00:00
Inbounds []Inbound `json:"inbounds,omitempty"`
Outbounds []Outbound `json:"outbounds,omitempty"`
Route *RouteOptions `json:"route,omitempty"`
2022-07-02 06:07:50 +00:00
}
2022-07-02 17:57:04 +00:00
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)
}
2022-07-02 06:07:50 +00:00
type LogOption struct {
Disabled bool `json:"disabled,omitempty"`
Level string `json:"level,omitempty"`
Output string `json:"output,omitempty"`
}