William Petit
e66938f1d3
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
32 lines
606 B
Go
32 lines
606 B
Go
package admin
|
|
|
|
import (
|
|
"forge.cadoles.com/cadoles/bouncer/internal/config"
|
|
)
|
|
|
|
type Option struct {
|
|
ServerConfig config.AdminServerConfig
|
|
RedisConfig config.RedisConfig
|
|
}
|
|
|
|
type OptionFunc func(*Option)
|
|
|
|
func defaultOption() *Option {
|
|
return &Option{
|
|
ServerConfig: config.NewDefaultAdminServerConfig(),
|
|
RedisConfig: config.NewDefaultRedisConfig(),
|
|
}
|
|
}
|
|
|
|
func WithServerConfig(conf config.AdminServerConfig) OptionFunc {
|
|
return func(opt *Option) {
|
|
opt.ServerConfig = conf
|
|
}
|
|
}
|
|
|
|
func WithRedisConfig(conf config.RedisConfig) OptionFunc {
|
|
return func(opt *Option) {
|
|
opt.RedisConfig = conf
|
|
}
|
|
}
|