dkv

package module
v0.0.0-...-3de9007 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: MIT Imports: 8 Imported by: 0

README

dkv

基于golang的高性能kv数据库 (持久化存储)

一种尝试

0.1版本

索引采用tree + hash 存储设计 每个存储块大小65535

Documentation

Overview

*

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

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

Collection describes a collection of key value pairs

func New

func New(name string) (*Collection, error)

New return a instance of collection

func (*Collection) Flush

func (c *Collection) Flush() error

Flush delete a collection with its value

func (*Collection) Get

func (c *Collection) Get(key string, value interface{}) error

Get retrieve a value from collection by key

func (*Collection) Has

func (c *Collection) Has(key string) bool

Has check a key exist in the collection

func (*Collection) List

func (c *Collection) List() ([]string, error)

List fetch all items key in collection

func (*Collection) Put

func (c *Collection) Put(key string, value interface{}) error

Put store a new key with value in the collection

func (*Collection) Remove

func (c *Collection) Remove(key string) error

Remove delete a key from collection

func (*Collection) TotalItem

func (c *Collection) TotalItem() int

TotalItem return total item count

Directories

Path Synopsis
*

Jump to

Keyboard shortcuts

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