5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-12-23 23:55:40 +00:00
yggdrasil-go/src/multicast/options.go

30 lines
524 B
Go
Raw Normal View History

package multicast
import "regexp"
func (m *Multicast) _applyOption(opt SetupOption) {
switch v := opt.(type) {
case MulticastInterface:
m.config._interfaces[v] = struct{}{}
case GroupAddress:
m.config._groupAddr = v
}
}
type SetupOption interface {
isSetupOption()
}
type MulticastInterface struct {
2022-10-26 17:25:48 +00:00
Regex *regexp.Regexp
Beacon bool
Listen bool
Port uint16
Priority uint8
}
type GroupAddress string
func (a MulticastInterface) isSetupOption() {}
func (a GroupAddress) isSetupOption() {}