1
0
mirror of https://github.com/nitezs/sub2sing-box.git synced 2024-12-23 21:34:41 -05:00
sub2sing-box/model/outbound.go
2024-10-03 01:24:54 +08:00

30 lines
560 B
Go

package model
import (
C "github.com/nitezs/sub2sing-box/constant"
"github.com/sagernet/sing-box/option"
)
type Outbound struct {
option.Outbound
}
func (h *Outbound) GetOutbounds() []string {
if h.Type == C.TypeSelector {
return h.SelectorOptions.Outbounds
}
if h.Type == C.TypeURLTest {
return h.URLTestOptions.Outbounds
}
return nil
}
func (h *Outbound) SetOutbounds(outbounds []string) {
if h.Type == C.TypeSelector {
h.SelectorOptions.Outbounds = outbounds
}
if h.Type == C.TypeURLTest {
h.URLTestOptions.Outbounds = outbounds
}
}