You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
331 B
Go
24 lines
331 B
Go
package endpointroles
|
|
|
|
type Options struct {
|
|
DefaultDeny bool
|
|
}
|
|
|
|
type Option func(o *Options)
|
|
|
|
func NoDefaultDeny() Option {
|
|
return func(o *Options) {
|
|
o.DefaultDeny = false
|
|
}
|
|
}
|
|
|
|
func NewOptions(opts ...Option) Options {
|
|
options := Options{
|
|
DefaultDeny: true,
|
|
}
|
|
for _, o := range opts {
|
|
o(&options)
|
|
}
|
|
return options
|
|
}
|