1
0
mirror of https://github.com/nitezs/sub2sing-box.git synced 2024-12-23 15:04:41 -05:00
sub2sing-box/model/outbound.go

30 lines
560 B
Go
Raw Normal View History

package model
import (
2024-09-19 06:12:24 -04:00
C "github.com/nitezs/sub2sing-box/constant"
2024-10-02 13:24:54 -04:00
"github.com/sagernet/sing-box/option"
)
2024-10-02 13:24:54 -04:00
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
}
}