leveldb

package
v0.0.73 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_levedb_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type CompletedConfig

type CompletedConfig struct {
	// contains filtered or unexported fields
}

func (CompletedConfig) New

func (c CompletedConfig) New() (*leveldb.ConsistentDB, error)

New creates a new server which logically combines the handling chain with the passed server. name is used to differentiate for logging. The handler chain in particular can be difficult as it starts delgating. New usually called after Complete

func (CompletedConfig) Validate added in v0.0.44

func (c CompletedConfig) Validate() error

Validate checks Config.

type Config

type Config struct {
	Proto     LevelDB
	Validator *validator.Validate
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig() *Config

NewConfig returns a Config struct with the default values

func NewViperConfig

func NewViperConfig(v *viper.Viper, keys ...string) *Config

NewViperConfig returns a Config struct with the global viper instance key representing a sub tree of this instance. NewViperConfig is case-insensitive for a key.

func (*Config) Complete

func (c *Config) Complete() CompletedConfig

Complete fills in any fields not set that are required to have valid data and can be derived from other fields. If you're going to ApplyOptions, do that first. It's mutating the receiver. ApplyOptions is called inside.

type LevelDB

type LevelDB struct {
	PathPrefix           string `protobuf:"bytes,1,opt,name=path_prefix,json=pathPrefix,proto3" json:"path_prefix,omitempty"`                                  // leveldb路径前缀
	CacheInMb            int32  `protobuf:"varint,2,opt,name=cache_in_mb,json=cacheInMb,proto3" json:"cache_in_mb,omitempty"`                                  // 每个leveldb数据库的内存cache,单位MiB,0则使用默认值
	PoolSize             int32  `protobuf:"varint,3,opt,name=pool_size,json=poolSize,proto3" json:"pool_size,omitempty"`                                       // leveldb文件个数,一致性哈希算法进行负载,提高并发性能
	MaxParallelConsumers int32  `protobuf:"varint,4,opt,name=max_parallel_consumers,json=maxParallelConsumers,proto3" json:"max_parallel_consumers,omitempty"` // leveldb并行消费消费者个数
	// contains filtered or unexported fields
}

func (*LevelDB) Descriptor deprecated

func (*LevelDB) Descriptor() ([]byte, []int)

Deprecated: Use LevelDB.ProtoReflect.Descriptor instead.

func (*LevelDB) GetCacheInMb

func (x *LevelDB) GetCacheInMb() int32

func (*LevelDB) GetMaxParallelConsumers

func (x *LevelDB) GetMaxParallelConsumers() int32

func (*LevelDB) GetPathPrefix

func (x *LevelDB) GetPathPrefix() string

func (*LevelDB) GetPoolSize

func (x *LevelDB) GetPoolSize() int32

func (*LevelDB) ProtoMessage

func (*LevelDB) ProtoMessage()

func (*LevelDB) ProtoReflect

func (x *LevelDB) ProtoReflect() protoreflect.Message

func (*LevelDB) Reset

func (x *LevelDB) Reset()

func (*LevelDB) String

func (x *LevelDB) String() string

Jump to

Keyboard shortcuts

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