26 lines
368 B
Go
26 lines
368 B
Go
package authn
|
|
|
|
type Options struct {
|
|
TemplateDir string
|
|
}
|
|
|
|
type OptionFunc func(*Options)
|
|
|
|
func NewOptions(funcs ...OptionFunc) *Options {
|
|
opts := &Options{
|
|
TemplateDir: "./templates",
|
|
}
|
|
|
|
for _, fn := range funcs {
|
|
fn(opts)
|
|
}
|
|
|
|
return opts
|
|
}
|
|
|
|
func WithTemplateDir(templateDir string) OptionFunc {
|
|
return func(o *Options) {
|
|
o.TemplateDir = templateDir
|
|
}
|
|
}
|