bouncer/internal/proxy/director/layer/authn/options.go
William Petit d5fed4c2ac
Some checks reported errors
Cadoles/bouncer/pipeline/head Something is wrong with the build of this commit
feat(authn): add templatized error page
ref CNOUS/mse#3907
2024-06-05 15:53:17 +02:00

34 lines
499 B
Go

package authn
type Options struct {
TemplateDir string
Debug bool
}
type OptionFunc func(*Options)
func NewOptions(funcs ...OptionFunc) *Options {
opts := &Options{
TemplateDir: "./templates",
Debug: false,
}
for _, fn := range funcs {
fn(opts)
}
return opts
}
func WithTemplateDir(templateDir string) OptionFunc {
return func(o *Options) {
o.TemplateDir = templateDir
}
}
func WithDebug(debug bool) OptionFunc {
return func(o *Options) {
o.Debug = debug
}
}