Documentation ¶
Overview ¶
Package config is used to generate filter by factory.
Index ¶
Constants ¶
View Source
const ( BitmapTypeInMemory BitmapType = "in-memory" BitmapTypeRedis BitmapType = "redis" RotatorModeDefault RotatorMode = "default" RotatorModeTruncatedTime RotatorMode = "truncated-time" )
Variables ¶
View Source
var ( ErrInvalidBitmapType = errors.New("invalid bitmap type") ErrInvalidRotatorMode = errors.New("invalid rotator mode") )
Functions ¶
This section is empty.
Types ¶
type BitmapConfig ¶
type BitmapConfig struct {
Type BitmapType
}
func (BitmapConfig) Validate ¶
func (b BitmapConfig) Validate() error
type BitmapType ¶
type BitmapType string
func (BitmapType) Validate ¶
func (b BitmapType) Validate() error
type FactoryConfig ¶
type FactoryConfig struct { FilterConfig FilterConfig RedisConfig RedisConfig RotatorConfig RotatorConfig }
func NewDefaultFactoryConfig ¶
func NewDefaultFactoryConfig() FactoryConfig
func (FactoryConfig) Validate ¶
func (c FactoryConfig) Validate() error
type FilterConfig ¶
type FilterConfig struct { BitmapConfig BitmapConfig // M is the number of bit in bloom filter. M uint64 // K is the number of hash function. K uint64 }
func (FilterConfig) Validate ¶
func (c FilterConfig) Validate() error
type RedisConfig ¶
func (RedisConfig) Validate ¶
func (c RedisConfig) Validate() error
type RotatorConfig ¶
type RotatorConfig struct { Enable bool Mode RotatorMode Freq time.Duration }
func (RotatorConfig) Validate ¶
func (c RotatorConfig) Validate() error
type RotatorMode ¶ added in v0.3.0
type RotatorMode string
func (RotatorMode) Validate ¶ added in v0.3.0
func (r RotatorMode) Validate() error
Click to show internal directories.
Click to hide internal directories.