Refactor admin socket setup (isolated config)

This commit is contained in:
Neil Alexander 2022-09-03 11:54:46 +01:00
parent 493208fb37
commit b1f61fb0a8
3 changed files with 70 additions and 58 deletions

16
src/admin/options.go Normal file
View 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() {}