forked from TrueCloudLab/frostfs-sdk-go
3a0c9e4542
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
34 lines
521 B
Go
34 lines
521 B
Go
package eacl
|
|
|
|
import (
|
|
"go.uber.org/zap"
|
|
)
|
|
|
|
// Option represents Validator option.
|
|
type Option func(*cfg)
|
|
|
|
type cfg struct {
|
|
logger *zap.Logger
|
|
|
|
storage Source
|
|
}
|
|
|
|
func defaultCfg() *cfg {
|
|
return &cfg{
|
|
logger: zap.L(),
|
|
}
|
|
}
|
|
|
|
// WithLogger configures the Validator to use logger v.
|
|
func WithLogger(v *zap.Logger) Option {
|
|
return func(c *cfg) {
|
|
c.logger = v
|
|
}
|
|
}
|
|
|
|
// WithEACLSource configures the validator to use v as eACL source.
|
|
func WithEACLSource(v Source) Option {
|
|
return func(c *cfg) {
|
|
c.storage = v
|
|
}
|
|
}
|