mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-29 06:35:07 +03:00
Refactor admin socket setup (isolated config)
This commit is contained in:
parent
493208fb37
commit
b1f61fb0a8
3 changed files with 70 additions and 58 deletions
16
src/admin/options.go
Normal file
16
src/admin/options.go
Normal file
|
@ -0,0 +1,16 @@
|
|||
package admin
|
||||
|
||||
func (c *AdminSocket) _applyOption(opt SetupOption) {
|
||||
switch v := opt.(type) {
|
||||
case ListenAddress:
|
||||
c.config.listenaddr = v
|
||||
}
|
||||
}
|
||||
|
||||
type SetupOption interface {
|
||||
isSetupOption()
|
||||
}
|
||||
|
||||
type ListenAddress string
|
||||
|
||||
func (a ListenAddress) isSetupOption() {}
|
Loading…
Add table
Add a link
Reference in a new issue