mirror of
https://github.com/nitezs/sub2sing-box.git
synced 2024-12-23 15:04:41 -05:00
30 lines
560 B
Go
Executable File
30 lines
560 B
Go
Executable File
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
|
|
}
|
|
}
|