bouncer/internal/proxy/director/layer/authn/options.go

34 lines
499 B
Go
Raw Normal View History

package authn
2023-07-06 03:19:45 +02:00
type Options struct {
TemplateDir string
Debug bool
2023-07-06 03:19:45 +02:00
}
type OptionFunc func(*Options)
func NewOptions(funcs ...OptionFunc) *Options {
opts := &Options{
2023-07-06 03:19:45 +02:00
TemplateDir: "./templates",
Debug: false,
2023-07-06 03:19:45 +02:00
}
for _, fn := range funcs {
fn(opts)
}
return opts
2023-07-06 03:19:45 +02:00
}
func WithTemplateDir(templateDir string) OptionFunc {
return func(o *Options) {
o.TemplateDir = templateDir
}
}
func WithDebug(debug bool) OptionFunc {
return func(o *Options) {
o.Debug = debug
}
}