Help us shape the future of Go! Take the 2026 Go Developer Survey

writecacheconfig

package
v0.46.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2025 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 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

	// CountLimitDefault is a default write-cache count limit.
	CountLimitDefault = 0

	MaxFlushingObjectsSizeDefault = 128 << 20
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config config.Config

Config is a wrapper over the config section which provides access to WriteCache configurations.

func From

func From(c *config.Config) *Config

From wraps config section into Config.

func (*Config) CountLimit added in v0.43.0

func (x *Config) CountLimit() uint64

CountLimit returns the value of "max_object_count" config parameter.

Returns CountLimitDefault if the value is not a positive number.

func (*Config) Enabled

func (x *Config) Enabled() bool

Enabled returns true if write-cache is enabled and false otherwise.

Panics if the value is not a boolean.

func (*Config) MaxFlushingObjectsSize added in v0.43.0

func (x *Config) MaxFlushingObjectsSize() uint64

MaxFlushingObjectsSize returns the value of "max_flushing_objects_size" config parameter.

Returns MaxFlushingObjectsSizeDefault if the value is not a positive number.

func (*Config) MaxObjectSize

func (x *Config) MaxObjectSize() uint64

MaxObjectSize returns the value of "max_object_size" config parameter.

Returns MaxSizeDefault if the value is not a positive number.

func (*Config) NoSync

func (x *Config) NoSync() bool

NoSync returns the value of "no_sync" config parameter.

Returns false if the value is not a boolean.

func (*Config) Path

func (x *Config) Path() string

Path returns the value of "path" config parameter.

Panics if the value is not a non-empty string.

func (*Config) SizeLimit

func (x *Config) SizeLimit() uint64

SizeLimit returns the value of "capacity" config parameter.

Returns SizeLimitDefault if the value is not a positive number.

func (*Config) WorkerCount added in v0.38.0

func (x *Config) WorkerCount() int

WorkerCount returns the value of "flush_worker_count" config parameter.

Returns WorkersNumberDefault if the value is not a positive number.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL