kvdb

package module
v0.0.0-...-4484d56 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

README

kvdb go-documentation

kv-db is a embedded key-value database.

package main

import "git.markveres.ro/mark/kvdb"

func main() {
    db, err := kvdb.Open(":memory:")
    if err != nil {
        panic(err)
    }

    db.Set("key", "value")
    db.Get("key")
}

Features

  • embedded
  • in memory or persistent
  • uses mutex for extra safety

TODO:

  • write the DB::Sort function
  • write the DB::Expire function

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

func Open

func Open(path string) (*DB, error)

func (*DB) Close

func (db *DB) Close() error

func (*DB) Delete

func (db *DB) Delete(key string)

func (*DB) Exists

func (db *DB) Exists(key string) bool

func (*DB) Flush

func (db *DB) Flush()

func (*DB) Get

func (db *DB) Get(key string) interface{}

func (*DB) Save

func (db *DB) Save() error

func (*DB) Set

func (db *DB) Set(key string, value interface{})

Jump to

Keyboard shortcuts

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