canodb

command module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: BSD-2-Clause Imports: 7 Imported by: 0

README

CanoDB

Go Reference Go Report Card build GitHub Release GitHub License

👋 Welcome to CanoDB.

Introduction

CanoDB is a distributed key-value database that draws on the characteristics of PostgreSQL and Redis databases. It provides TCP client and server, expanding the goLevelDB database. The environmental requirement is at least Go 1.22.

Usage

The client part is introduced into the code through go import. The server part is compiled and run in binary form or Docker image form.

Client

Download client package:

go get github.com/lindsuen/canodb/client

Import client package and connect to a database:

import "github.com/lindsuen/canodb/client"

// ...
// The default port of CanoDB server is 4644.
db, err := client.Connect("127.0.0.1:4644")
// ...
defer db.Close()
// ...

Read or modify the database content:

// ...
err := db.Put([]byte("key"), []byte("value"))
// ...
err = db.Delete([]byte("key"))
// ...
value, err = db.Get([]byte("key"))
// ...
Server

Place the downloaded or compiled binary file canodb in the corresponding directory, and then execute:

./canodb

Build

It is recommended to build on the Debian operating system. The make tool is necessary, and you can install it through the command apt install -y build-essential.

Binary
cd canodb/ && go build -o bin/canodb .
Docker
cd canodb/ && make build
docker build --no-cache -t canodb/canodb-server:latest .

License

BSD-2-Clause license

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package leveldb provides implementation of LevelDB key/value database.
Package leveldb provides implementation of LevelDB key/value database.
cache
Package cache provides interface and implementation of a cache algorithms.
Package cache provides interface and implementation of a cache algorithms.
comparer
Package comparer provides interface and implementation for ordering sets of data.
Package comparer provides interface and implementation for ordering sets of data.
errors
Package errors provides common error types used throughout leveldb.
Package errors provides common error types used throughout leveldb.
filter
Package filter provides interface and implementation of probabilistic data structure.
Package filter provides interface and implementation of probabilistic data structure.
iterator
Package iterator provides interface and implementation to traverse over contents of a database.
Package iterator provides interface and implementation to traverse over contents of a database.
journal
Package journal reads and writes sequences of journals.
Package journal reads and writes sequences of journals.
memdb
Package memdb provides in-memory key/value database implementation.
Package memdb provides in-memory key/value database implementation.
opt
Package opt provides sets of options used by LevelDB.
Package opt provides sets of options used by LevelDB.
storage
Package storage provides storage abstraction for LevelDB.
Package storage provides storage abstraction for LevelDB.
table
Package table allows read and write sorted key/value.
Package table allows read and write sorted key/value.
util
Package util provides utilities used throughout leveldb.
Package util provides utilities used throughout leveldb.
util
db
log

Jump to

Keyboard shortcuts

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