Documentation ¶
Index ¶
- Constants
- type Config
- func (x *Config) BoltDB() *boltdbconfig.Config
- func (x *Config) Enabled() bool
- func (x *Config) GCInterval() time.Duration
- func (x *Config) MaxObjectSize() uint64
- func (x *Config) NoSync() bool
- func (x *Config) Path() string
- func (x *Config) SizeLimit() uint64
- func (x *Config) SmallObjectSize() uint64
- func (x *Config) Type() writecacheconfig.Type
- func (x *Config) WorkersNumber() int
Constants ¶
const ( // SmallSizeDefault is a default size of small objects. SmallSizeDefault = 32 << 10 // MaxSizeDefault is a default value of the object payload size limit. MaxSizeDefault = 64 << 20 // WorkersNumberDefault is a default number of workers. WorkersNumberDefault = 20 // SizeLimitDefault is a default write-cache size limit. SizeLimitDefault = 1 << 30 // DefaultGCInterval is the default duration of the GC cycle interval. DefaultGCInterval = 1 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
Config is a wrapper over the config section which provides access to WriteCache configurations.
func (*Config) BoltDB ¶
func (x *Config) BoltDB() *boltdbconfig.Config
BoltDB returns config instance for querying bolt db specific parameters.
func (*Config) Enabled ¶
Enabled returns true if write-cache is enabled and false otherwise.
Panics if the value is not a boolean.
func (*Config) GCInterval ¶ added in v0.37.0
GCInterval returns the value of "gc_interval" config parameter.
Returns DefaultGCInterval if the value is not a positive duration.
func (*Config) MaxObjectSize ¶
MaxObjectSize returns the value of "max_object_size" config parameter.
Returns MaxSizeDefault if the value is not a positive number.
func (*Config) NoSync ¶
NoSync returns the value of "no_sync" config parameter.
Returns false if the value is not a boolean.
func (*Config) Path ¶
Path returns the value of "path" config parameter.
Panics if the value is not a non-empty string.
func (*Config) SizeLimit ¶
SizeLimit returns the value of "capacity" config parameter.
Returns SizeLimitDefault if the value is not a positive number.
func (*Config) SmallObjectSize ¶
SmallObjectSize returns the value of "small_object_size" config parameter.
Returns SmallSizeDefault if the value is not a positive number.
func (*Config) Type ¶ added in v0.37.0
func (x *Config) Type() writecacheconfig.Type
Type returns the writecache implementation type to use.
Panics if the type is not recognized.
func (*Config) WorkersNumber ¶
WorkersNumber returns the value of "workers_number" config parameter.
Returns WorkersNumberDefault if the value is not a positive number.