config

package
v0.0.0-...-fc1ef06 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2016 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAddr     string = "127.0.0.1:6380"
	DefaultHttpAddr string = "127.0.0.1:11181"

	DefaultDBName string = "goleveldb"

	DefaultDataDir string = "./data"
)
View Source
const (
	MaxBinLogFileSize int = 1024 * 1024 * 1024
	MaxBinLogFileNum  int = 10000

	DefaultBinLogFileSize int = MaxBinLogFileSize
	DefaultBinLogFileNum  int = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BinLogConfig

type BinLogConfig struct {
	MaxFileSize int `toml:"max_file_size"`
	MaxFileNum  int `toml:"max_file_num"`
}

func (*BinLogConfig) Adjust

func (cfg *BinLogConfig) Adjust()

type Config

type Config struct {
	DataDir string `toml:"data_dir"`

	DBName string `toml:"db_name"`

	LevelDB LevelDBConfig `toml:"leveldb"`

	LMDB LMDBConfig `toml:"lmdb"`

	BinLog BinLogConfig `toml:"binlog"`

	SlaveOf string `toml:"slaveof"`

	AccessLog string `toml:"access_log"`
}

func NewConfigDefault

func NewConfigDefault() *Config

func NewConfigWithData

func NewConfigWithData(data []byte) (*Config, error)

func NewConfigWithFile

func NewConfigWithFile(fileName string) (*Config, error)

type LMDBConfig

type LMDBConfig struct {
	MapSize int  `toml:"map_size"`
	NoSync  bool `toml:"nosync"`
}

type LevelDBConfig

type LevelDBConfig struct {
	Compression     bool `toml:"compression"`
	BlockSize       int  `toml:"block_size"`
	WriteBufferSize int  `toml:"write_buffer_size"`
	CacheSize       int  `toml:"cache_size"`
	MaxOpenFiles    int  `toml:"max_open_files"`
}

func (*LevelDBConfig) Adjust

func (cfg *LevelDBConfig) Adjust()

type Size

type Size int

Jump to

Keyboard shortcuts

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