Skip to content

clients.zdb #

Vlang ZDB Client

to use:

to use test

##r#mkdir -p ~/.zdb
zdb --socket ~/.zdb/socket --admin 1234
redis-cli -s ~/.zdb/socket
#redis-cli -s ~/.zdb/socket --raw nsinfo default

then in the redis-cli can do e.g.

nsinfo default

fn get #

fn get(addr string, auth string, namespace string) !ZDB

https://redis.io/topics/protocol examples: localhost:6379 /tmp/redis-default.sock

struct ScanArgs #

struct ScanArgs {
	cursor string
}

struct ZDB #

struct ZDB {
pub mut:
	redis redisclient.Redis
}

fn (ZDB) ping #

fn (mut zdb ZDB) ping() !string

fn (ZDB) set #

fn (mut zdb ZDB) set(key string, val string) !string

if key not specified will get incremental key

fn (ZDB) get #

fn (mut zdb ZDB) get(key string) !string

fn (ZDB) mget #

fn (mut zdb ZDB) mget(key string) !string

fn (ZDB) del #

fn (mut zdb ZDB) del(key string) !string

fn (ZDB) stop #

fn (mut zdb ZDB) stop() !string

used only for debugging, to check memory leaks

fn (ZDB) exists #

fn (mut zdb ZDB) exists(key string) !string

fn (ZDB) check #

fn (mut zdb ZDB) check(key string) !string

fn (ZDB) keycur #

fn (mut zdb ZDB) keycur(key string) !string

fn (ZDB) info #

fn (mut zdb ZDB) info() !string

fn (ZDB) nsnew #

fn (mut zdb ZDB) nsnew(namespace string) !string

fn (ZDB) nsdel #

fn (mut zdb ZDB) nsdel(namespace string) !string

fn (ZDB) nsinfo #

fn (mut zdb ZDB) nsinfo(namespace string) !map[string]string

fn (ZDB) nslist #

fn (mut zdb ZDB) nslist() ![]string

fn (ZDB) nssset #

fn (mut zdb ZDB) nssset(ns string, prop string, val string) !string

fn (ZDB) select_ns #

fn (mut zdb ZDB) select_ns(args SelectArgs) !string

fn (ZDB) dbsize #

fn (mut zdb ZDB) dbsize() !string

fn (ZDB) time #

fn (mut zdb ZDB) time() !string

fn (ZDB) auth #

fn (mut zdb ZDB) auth(password string) !string

fn (ZDB) auth_secure #

fn (mut zdb ZDB) auth_secure() !string

fn (ZDB) scan #

fn (mut zdb ZDB) scan(args ScanArgs) !string

fn (ZDB) scanx #

fn (mut zdb ZDB) scanx(args ScanArgs) !string

this is just an alias for SCAN

fn (ZDB) rscan #

fn (mut zdb ZDB) rscan(args ScanArgs) !string

fn (ZDB) wait #

fn (mut zdb ZDB) wait(args WaitArgs) !string

fn (ZDB) history #

fn (mut zdb ZDB) history(args HistoryArgs) ![]string

fn (ZDB) flush #

fn (mut zdb ZDB) flush() !string

fn (ZDB) hooks #

fn (mut zdb ZDB) hooks() ![]string

fn (ZDB) index_dirty #

fn (mut zdb ZDB) index_dirty() ![]string

fn (ZDB) index_dirty_reset #

fn (mut zdb ZDB) index_dirty_reset() !string