2024-05-17 17:29:26 +02:00
|
|
|
package authn
|
2023-07-06 03:19:45 +02:00
|
|
|
|
|
|
|
type Options struct {
|
|
|
|
TemplateDir string
|
|
|
|
}
|
|
|
|
|
|
|
|
type OptionFunc func(*Options)
|
|
|
|
|
2024-05-17 17:29:26 +02:00
|
|
|
func NewOptions(funcs ...OptionFunc) *Options {
|
|
|
|
opts := &Options{
|
2023-07-06 03:19:45 +02:00
|
|
|
TemplateDir: "./templates",
|
|
|
|
}
|
2024-05-17 17:29:26 +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
|
|
|
|
}
|
|
|
|
}
|