config

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultIteratorOptions = IteratorOptions{
	Prefix:  nil,
	Reverse: false,
}
View Source
var DefaultOptions = Options{
	DirPath:      os.TempDir(),
	DataFileSize: 256 * 1024 * 1024,
	SyncWrite:    false,
	IndexType:    Btree,
}
View Source
var DefaultWriteBatchOptions = WriteBatchOptions{
	MaxBatchNum: 10000,
	SyncWrites:  true,
}

Functions

This section is empty.

Types

type IndexerType

type IndexerType = int8
const (
	// Btree 索引
	Btree IndexerType = iota + 1

	// ART (Adpative Radix Tree) 自适应基数树
	ART
)

type IteratorOptions

type IteratorOptions struct {
	// 遍历前缀为指定值的 Key,默认为空
	Prefix []byte
	// 是否反向遍历,默认 false 是正向
	Reverse bool
}

IteratorOptions 索引迭代器配置项

type Options

type Options struct {
	DirPath      string //数据库数据目录
	DataFileSize int64  //数据文件的大小
	SyncWrite    bool   // 每次写数据是否持久化
	IndexType    IndexerType
}

type TcpServerConfiguration

type TcpServerConfiguration struct {
	Host       string
	Port       int
	MaxClients int
}

TcpServerConfiguration define global tcp server config

var Configuration *TcpServerConfiguration

Configuration is global tcp server config

func Init

func Init() *TcpServerConfiguration

Init init global tcp server config

type WriteBatchOptions

type WriteBatchOptions struct {
	// 一个批次当中最大的数据量
	MaxBatchNum uint
	// 提交时是否 sync 持久化
	SyncWrites bool
}

WriteBatchOptions 批量写入配置项

Jump to

Keyboard shortcuts

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