writecacheconfig

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2021 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MemSizeDefault is a default memory size.
	MemSizeDefault = 1 << 30

	// 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
)

config defaults

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) MaxObjectSize

func (x *Config) MaxObjectSize() uint64

MaxObjectSize returns value of "max_size" config parameter.

Returns MaxSizeDefault if value is not a positive number.

func (*Config) MemSize

func (x *Config) MemSize() uint64

MemSize returns value of "mem_size" config parameter.

Returns MemSizeDefault if value is not a positive number.

func (*Config) Path

func (x *Config) Path() string

Path returns value of "path" config parameter.

Panics if value is not a non-empty string.

func (*Config) SmallObjectSize

func (x *Config) SmallObjectSize() uint64

SmallObjectSize returns value of "small_size" config parameter.

Returns SmallSizeDefault if value is not a positive number.

func (*Config) WorkersNumber

func (x *Config) WorkersNumber() int

WorkersNumber returns value of "workers_number" config parameter.

Returns WorkersNumberDefault if value is not a positive number.

Jump to

Keyboard shortcuts

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