34 lines
561 B
Go
Raw Normal View History

2025-02-21 18:42:56 +01:00
package auth
type Options struct {
2025-02-22 09:42:15 +01:00
Providers []Provider
SessionName string
2025-02-21 18:42:56 +01:00
}
type OptionFunc func(opts *Options)
func NewOptions(funcs ...OptionFunc) *Options {
opts := &Options{
Providers: make([]Provider, 0),
2025-02-22 09:42:15 +01:00
SessionName: "clearcase_auth",
2025-02-21 18:42:56 +01:00
}
for _, fn := range funcs {
fn(opts)
}
return opts
}
func WithProviders(providers ...Provider) OptionFunc {
return func(opts *Options) {
opts.Providers = providers
}
}
func WithSessionName(sessionName string) OptionFunc {
return func(opts *Options) {
opts.SessionName = sessionName
}
}