mirror of
https://github.com/EchoVault/SugarDB.git
synced 2025-09-26 20:11:15 +08:00
Rename the project to SugarDB. (#130)
Renames project to "SugarDB" - @kelvinmwinuka
This commit is contained in:
4
.github/workflows/go.yml
vendored
4
.github/workflows/go.yml
vendored
@@ -27,7 +27,7 @@ jobs:
|
||||
go-version: '1.21.4'
|
||||
|
||||
- name: Build
|
||||
run: go build -v -o bin/echovault ./cmd/...
|
||||
run: go build -v -o bin/sugardb ./cmd/...
|
||||
|
||||
- name: Test
|
||||
run: make test
|
||||
@@ -40,7 +40,7 @@ jobs:
|
||||
with:
|
||||
directory: ./coverage
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
slug: EchoVault/EchoVault
|
||||
slug: EchoVault/SugarDB
|
||||
|
||||
- name: Go report card
|
||||
uses: creekorful/goreportcard-action@v1.0
|
||||
|
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
@@ -56,7 +56,7 @@ jobs:
|
||||
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
|
||||
with:
|
||||
images: |
|
||||
echovault/echovault
|
||||
echovault/sugardb
|
||||
ghcr.io/${{ github.repository }}
|
||||
- name: Build and push Docker images
|
||||
id: push
|
||||
@@ -70,7 +70,7 @@ jobs:
|
||||
- name: Generate artifact attestation
|
||||
uses: actions/attest-build-provenance@v1
|
||||
with:
|
||||
subject-name: ghcr.io/echovault/echovault
|
||||
subject-name: ghcr.io/echovault/sugardb
|
||||
subject-digest: ${{ steps.push.outputs.digest }}
|
||||
push-to-registry: true
|
||||
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@@ -5,5 +5,5 @@ internal/volumes/nodes
|
||||
dist/
|
||||
dump.rdb
|
||||
**/*/testdata
|
||||
echovault/aof
|
||||
sugardb/aof
|
||||
aof
|
||||
|
@@ -18,11 +18,11 @@ builds:
|
||||
- arm64
|
||||
|
||||
brews:
|
||||
- name: echovault
|
||||
homepage: https://github.com/EchoVault/EchoVault
|
||||
- name: sugardb
|
||||
homepage: https://github.com/EchoVault/SugarDB
|
||||
repository:
|
||||
owner: EchoVault
|
||||
name: Homebrew-EchoVault
|
||||
name: Homebrew
|
||||
commit_author:
|
||||
name: kelvinmwinuka
|
||||
email: kelvin@echovault.io
|
||||
|
@@ -18,16 +18,16 @@ RUN CGO_ENABLED=$CGO_ENABLED CC=$CC GOOS=$GOOS GOARCH=$GOARCH go build -o $DEST/
|
||||
|
||||
FROM --platform=linux/amd64 alpine:latest AS server
|
||||
|
||||
RUN mkdir -p /usr/echovault/bin/modules
|
||||
RUN mkdir -p /etc/ssl/certs/echovault/server
|
||||
RUN mkdir -p /etc/ssl/certs/echovault/client
|
||||
RUN mkdir -p /usr/sugardb/bin/modules
|
||||
RUN mkdir -p /etc/ssl/certs/sugardb/server
|
||||
RUN mkdir -p /etc/ssl/certs/sugardb/client
|
||||
|
||||
COPY --from=build /build/volumes/modules /usr/echovault/bin/modules
|
||||
COPY --from=build /build/bin/server /usr/echovault/bin
|
||||
COPY ./openssl/server /etc/ssl/certs/echovault/server
|
||||
COPY ./openssl/client /etc/ssl/certs/echovault/client
|
||||
COPY --from=build /build/volumes/modules /usr/sugardb/bin/modules
|
||||
COPY --from=build /build/bin/server /usr/sugardb/bin
|
||||
COPY ./openssl/server /etc/ssl/certs/sugardb/server
|
||||
COPY ./openssl/client /etc/ssl/certs/sugardb/client
|
||||
|
||||
WORKDIR /usr/echovault/bin
|
||||
WORKDIR /usr/sugardb/bin
|
||||
|
||||
CMD "./server" \
|
||||
"--bind-addr" "${BIND_ADDR}" \
|
||||
@@ -52,7 +52,7 @@ CMD "./server" \
|
||||
"--restore-snapshot=${RESTORE_SNAPSHOT}" \
|
||||
"--restore-aof=${RESTORE_AOF}" \
|
||||
"--aof-sync-strategy=${AOF_SYNC_STRATEGY}" \
|
||||
# List of echovault cert/key pairs
|
||||
# List of sugardb cert/key pairs
|
||||
"--cert-key-pair=${CERT_KEY_PAIR_1}" \
|
||||
"--cert-key-pair=${CERT_KEY_PAIR_2}" \
|
||||
# List of client certs
|
||||
|
@@ -5,7 +5,7 @@ COPY . ./
|
||||
RUN CGO_ENABLED=1 CC=gcc GOOS=linux GOARCH=amd64 go build -o bin/server ./cmd/...
|
||||
|
||||
FROM --platform=linux/amd64 alpine:latest AS server
|
||||
RUN mkdir -p /usr/echovault/bin
|
||||
COPY --from=build /build/bin/server /usr/echovault/bin
|
||||
WORKDIR /usr/echovault/bin
|
||||
RUN mkdir -p /usr/sugardb/bin
|
||||
COPY --from=build /build/bin/server /usr/sugardb/bin
|
||||
WORKDIR /usr/sugardb/bin
|
||||
ENTRYPOINT ["./server"]
|
4
Makefile
4
Makefile
@@ -13,12 +13,12 @@ build-modules-test:
|
||||
|
||||
test:
|
||||
env RACE=false OUT=internal/modules/admin/testdata make build-modules-test && \
|
||||
env RACE=false OUT=echovault/testdata make build-modules-test && \
|
||||
env RACE=false OUT=sugardb/testdata make build-modules-test && \
|
||||
CGO_ENABLED=1 go test ./... -coverprofile coverage/coverage.out
|
||||
|
||||
test-race:
|
||||
env RACE=true OUT=internal/modules/admin/testdata make build-modules-test && \
|
||||
env RACE=true OUT=echovault/testdata make build-modules-test && \
|
||||
env RACE=true OUT=sugardb/testdata make build-modules-test && \
|
||||
CGO_ENABLED=1 go test ./... --race
|
||||
|
||||
test-win:
|
||||
|
300
README.md
300
README.md
@@ -1,9 +1,9 @@
|
||||
[]()
|
||||
[]()
|
||||
[](https://goreportcard.com/report/github.com/echovault/echovault)
|
||||
[](https://codecov.io/gh/EchoVault/EchoVault)
|
||||
[](https://codecov.io/gh/EchoVault/SugarDB)
|
||||
<br/>
|
||||
[](https://pkg.go.dev/github.com/echovault/echovault)
|
||||
[]()
|
||||
[](https://pkg.go.dev/github.com/echovault/sugardb)
|
||||
[]()
|
||||
[](https://www.apache.org/licenses/LICENSE-2.0)
|
||||
<br/>
|
||||
[](https://github.com/avelino/awesome-go)
|
||||
@@ -12,10 +12,8 @@
|
||||
|
||||
<hr/>
|
||||
|
||||
<img alt="echovault_logo" src="./images/EchoVault GitHub Cover.png" width="5062" />
|
||||
|
||||
# Table of Contents
|
||||
1. [What is EchoVault](#what-is-echovault)
|
||||
1. [What is SugarDB](#what-is-sugardb)
|
||||
2. [Features](#features)
|
||||
3. [Usage (Embedded)](#usage-embedded)
|
||||
4. [Usage (Client-Server)](#usage-client-server)
|
||||
@@ -37,32 +35,32 @@
|
||||
9. [SORTED SET](#commands-sortedset)
|
||||
10. [STRING](#commands-string)
|
||||
|
||||
<a name="what-is-echovault"></a>
|
||||
# What is EchoVault?
|
||||
<a name="what-is-sugardb"></a>
|
||||
# What is SugarDB?
|
||||
|
||||
EchoVault is a highly configurable, distributed, in-memory data store and cache implemented in Go.
|
||||
SugarDB is a highly configurable, distributed, in-memory data store and cache implemented in Go.
|
||||
It can be imported as a Go library or run as an independent service.
|
||||
|
||||
EchoVault aims to provide a rich set of data structures and functions for
|
||||
SugarDB aims to provide a rich set of data structures and functions for
|
||||
manipulating data in memory. These data structures include, but are not limited to:
|
||||
Lists, Sets, Sorted Sets, Hashes, and much more to come soon.
|
||||
|
||||
EchoVault provides a persistence layer for increased reliability. Both Append-Only files
|
||||
SugarDB provides a persistence layer for increased reliability. Both Append-Only files
|
||||
and snapshots can be used to persist data in the disk for recovery in case of unexpected shutdowns.
|
||||
|
||||
Replication is a core feature of EchoVault and is implemented using the RAFT algorithm,
|
||||
allowing you to create a fault-tolerant cluster of EchoVault nodes to improve reliability.
|
||||
If you do not need a replication cluster, you can always run EchoVault
|
||||
Replication is a core feature of SugarDB and is implemented using the RAFT algorithm,
|
||||
allowing you to create a fault-tolerant cluster of SugarDB nodes to improve reliability.
|
||||
If you do not need a replication cluster, you can always run SugarDB
|
||||
in standalone mode and have a fully capable single node.
|
||||
|
||||
EchoVault aims to not only be a server but to be importable to existing
|
||||
projects to enhance them with EchoVault features, this
|
||||
SugarDB aims to not only be a server but to be importable to existing
|
||||
projects to enhance them with SugarDB features, this
|
||||
capability is always being worked on and improved.
|
||||
|
||||
<a name="features"></a>
|
||||
# Features
|
||||
|
||||
Features offered by EchoVault include:
|
||||
Features offered by SugarDB include:
|
||||
|
||||
1) TLS and mTLS support for multiple server and client RootCAs.
|
||||
2) Replication cluster support using the RAFT algorithm.
|
||||
@@ -75,7 +73,7 @@ Features offered by EchoVault include:
|
||||
9) Command extension via embedded API.
|
||||
10) Multi-database support for key namespacing.
|
||||
|
||||
We are working hard to add more features to EchoVault to make it
|
||||
We are working hard to add more features to SugarDB to make it
|
||||
much more powerful. Features in the roadmap include:
|
||||
|
||||
1) Sharding
|
||||
@@ -91,30 +89,30 @@ much more powerful. Features in the roadmap include:
|
||||
<a name="usage-embedded"></a>
|
||||
# Usage (Embedded)
|
||||
|
||||
Install EchoVault with: `go get github.com/echovault/echovault`.
|
||||
Install SugarDB with: `go get github.com/echovault/sugardb`.
|
||||
|
||||
Here's an example of using EchoVault as an embedded library.
|
||||
You can access all of EchoVault's commands using an ergonomic API.
|
||||
Here's an example of using SugarDB as an embedded library.
|
||||
You can access all of SugarDB's commands using an ergonomic API.
|
||||
|
||||
```go
|
||||
func main() {
|
||||
server, err := echovault.NewEchoVault()
|
||||
server, err := sugardb.NewSugarDB()
|
||||
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
_, _, _ = server.Set("key", "Hello, world!", echovault.SETOptions{})
|
||||
_, _, _ = server.Set("key", "Hello, world!", sugardb.SETOptions{})
|
||||
|
||||
v, _ := server.Get("key")
|
||||
fmt.Println(v) // Hello, world!
|
||||
|
||||
// (Optional): Listen for TCP connections on this EchoVault instance.
|
||||
// (Optional): Listen for TCP connections on this SugarDB instance.
|
||||
server.Start()
|
||||
}
|
||||
```
|
||||
|
||||
An embedded EchoVault instance can still be part of a cluster, and the changes triggered
|
||||
An embedded SugarDB instance can still be part of a cluster, and the changes triggered
|
||||
from the API will be consistent across the cluster.
|
||||
|
||||
<a name="usage-client-server"></a>
|
||||
@@ -133,16 +131,16 @@ Once installed, you can run the server with the following command:
|
||||
<a name="usage-docker"></a>
|
||||
### Docker
|
||||
|
||||
`docker pull echovault/echovault`
|
||||
`docker pull echovault/sugardb`
|
||||
|
||||
The full list of tags can be found [here](https://hub.docker.com/r/echovault/echovault/tags).
|
||||
|
||||
<a name="usage-container-registry"></a>
|
||||
### Container Registry
|
||||
|
||||
`docker pull ghcr.io/echovault/echovault`
|
||||
`docker pull ghcr.io/echovault/sugardb`
|
||||
|
||||
The full list of tags can be found [here](https://github.com/EchoVault/EchoVault/pkgs/container/echovault).
|
||||
The full list of tags can be found [here](https://github.com/EchoVault/SugarDB/pkgs/container/sugardb).
|
||||
|
||||
<a name="usage-binaries"></a>
|
||||
### Binaries
|
||||
@@ -153,7 +151,7 @@ the binary for your system.
|
||||
<a name="clients"></a>
|
||||
# Clients
|
||||
|
||||
EchoVault uses RESP, which makes it compatible with existing
|
||||
SugarDB uses RESP, which makes it compatible with existing
|
||||
Redis clients.
|
||||
|
||||
<a name="benchmarks"></a>
|
||||
@@ -189,154 +187,154 @@ MSET (10 keys): 56022.41 requests per second, p50=0.463 msec
|
||||
|
||||
<a name="commands-acl"></a>
|
||||
## ACL
|
||||
* [ACL CAT](https://echovault.io/docs/commands/acl/acl_cat)
|
||||
* [ACL DELUSER](https://echovault.io/docs/commands/acl/acl_deluser)
|
||||
* [ACL GETUSER](https://echovault.io/docs/commands/acl/acl_getuser)
|
||||
* [ACL LIST](https://echovault.io/docs/commands/acl/acl_list)
|
||||
* [ACL LOAD](https://echovault.io/docs/commands/acl/acl_load)
|
||||
* [ACL SAVE](https://echovault.io/docs/commands/acl/acl_save)
|
||||
* [ACL SETUSER](https://echovault.io/docs/commands/acl/acl_setuser)
|
||||
* [ACL USERS](https://echovault.io/docs/commands/acl/acl_users)
|
||||
* [ACL WHOAMI](https://echovault.io/docs/commands/acl/acl_whoami)
|
||||
* [ACL CAT](https://sugardb.io/docs/commands/acl/acl_cat)
|
||||
* [ACL DELUSER](https://sugardb.io/docs/commands/acl/acl_deluser)
|
||||
* [ACL GETUSER](https://sugardb.io/docs/commands/acl/acl_getuser)
|
||||
* [ACL LIST](https://sugardb.io/docs/commands/acl/acl_list)
|
||||
* [ACL LOAD](https://sugardb.io/docs/commands/acl/acl_load)
|
||||
* [ACL SAVE](https://sugardb.io/docs/commands/acl/acl_save)
|
||||
* [ACL SETUSER](https://sugardb.io/docs/commands/acl/acl_setuser)
|
||||
* [ACL USERS](https://sugardb.io/docs/commands/acl/acl_users)
|
||||
* [ACL WHOAMI](https://sugardb.io/docs/commands/acl/acl_whoami)
|
||||
|
||||
<a name="commands-admin"></a>
|
||||
## ADMIN
|
||||
* [COMMAND COUNT](https://echovault.io/docs/commands/admin/command_count)
|
||||
* [COMMAND LIST](https://echovault.io/docs/commands/admin/command_list)
|
||||
* [COMMANDS](https://echovault.io/docs/commands/admin/commands)
|
||||
* [LASTSAVE](https://echovault.io/docs/commands/admin/lastsave)
|
||||
* [MODULE LIST](https://echovault.io/docs/commands/admin/module_list)
|
||||
* [MODULE LOAD](https://echovault.io/docs/commands/admin/module_load)
|
||||
* [MODULE UNLOAD](https://echovault.io/docs/commands/admin/module_unload)
|
||||
* [REWRITEAOF](https://echovault.io/docs/commands/admin/rewriteaof)
|
||||
* [SAVE](https://echovault.io/docs/commands/admin/save)
|
||||
* [COMMAND COUNT](https://sugardb.io/docs/commands/admin/command_count)
|
||||
* [COMMAND LIST](https://sugardb.io/docs/commands/admin/command_list)
|
||||
* [COMMANDS](https://sugardb.io/docs/commands/admin/commands)
|
||||
* [LASTSAVE](https://sugardb.io/docs/commands/admin/lastsave)
|
||||
* [MODULE LIST](https://sugardb.io/docs/commands/admin/module_list)
|
||||
* [MODULE LOAD](https://sugardb.io/docs/commands/admin/module_load)
|
||||
* [MODULE UNLOAD](https://sugardb.io/docs/commands/admin/module_unload)
|
||||
* [REWRITEAOF](https://sugardb.io/docs/commands/admin/rewriteaof)
|
||||
* [SAVE](https://sugardb.io/docs/commands/admin/save)
|
||||
|
||||
<a name="commands-connection"></a>
|
||||
## CONNECTION
|
||||
* [AUTH](https://echovault.io/docs/commands/connection/auth)
|
||||
* [HELLO](https://echovault.io/docs/commands/connection/hello)
|
||||
* [PING](https://echovault.io/docs/commands/connection/ping)
|
||||
* [SELECT](https://echovault.io/docs/commands/connection/select)
|
||||
* [SWAPDB](https://echovault.io/docs/commands/connection/swapdb)
|
||||
* [AUTH](https://sugardb.io/docs/commands/connection/auth)
|
||||
* [HELLO](https://sugardb.io/docs/commands/connection/hello)
|
||||
* [PING](https://sugardb.io/docs/commands/connection/ping)
|
||||
* [SELECT](https://sugardb.io/docs/commands/connection/select)
|
||||
* [SWAPDB](https://sugardb.io/docs/commands/connection/swapdb)
|
||||
|
||||
<a name="commands-generic"></a>
|
||||
## GENERIC
|
||||
* [DECR](https://echovault.io/docs/commands/generic/decr)
|
||||
* [DECRBY](https://echovault.io/docs/commands/generic/decrby)
|
||||
* [DEL](https://echovault.io/docs/commands/generic/del)
|
||||
* [EXPIRE](https://echovault.io/docs/commands/generic/expire)
|
||||
* [EXPIRETIME](https://echovault.io/docs/commands/generic/expiretime)
|
||||
* [FLUSHALL](https://echovault.io/docs/commands/generic/flushall)
|
||||
* [FLUSHDB](https://echovault.io/docs/commands/generic/flushdb)
|
||||
* [GET](https://echovault.io/docs/commands/generic/get)
|
||||
* [INCR](https://echovault.io/docs/commands/generic/incr)
|
||||
* [INCRBY](https://echovault.io/docs/commands/generic/incrby)
|
||||
* [MGET](https://echovault.io/docs/commands/generic/mget)
|
||||
* [MSET](https://echovault.io/docs/commands/generic/mset)
|
||||
* [PERSIST](https://echovault.io/docs/commands/generic/persist)
|
||||
* [PEXPIRE](https://echovault.io/docs/commands/generic/pexpire)
|
||||
* [PEXPIRETIME](https://echovault.io/docs/commands/generic/pexpiretime)
|
||||
* [PTTL](https://echovault.io/docs/commands/generic/pttl)
|
||||
* [RENAME](https://echovault.io/docs/commands/generic/rename)
|
||||
* [SET](https://echovault.io/docs/commands/generic/set)
|
||||
* [TTL](https://echovault.io/docs/commands/generic/ttl)
|
||||
* [DECR](https://sugardb.io/docs/commands/generic/decr)
|
||||
* [DECRBY](https://sugardb.io/docs/commands/generic/decrby)
|
||||
* [DEL](https://sugardb.io/docs/commands/generic/del)
|
||||
* [EXPIRE](https://sugardb.io/docs/commands/generic/expire)
|
||||
* [EXPIRETIME](https://sugardb.io/docs/commands/generic/expiretime)
|
||||
* [FLUSHALL](https://sugardb.io/docs/commands/generic/flushall)
|
||||
* [FLUSHDB](https://sugardb.io/docs/commands/generic/flushdb)
|
||||
* [GET](https://sugardb.io/docs/commands/generic/get)
|
||||
* [INCR](https://sugardb.io/docs/commands/generic/incr)
|
||||
* [INCRBY](https://sugardb.io/docs/commands/generic/incrby)
|
||||
* [MGET](https://sugardb.io/docs/commands/generic/mget)
|
||||
* [MSET](https://sugardb.io/docs/commands/generic/mset)
|
||||
* [PERSIST](https://sugardb.io/docs/commands/generic/persist)
|
||||
* [PEXPIRE](https://sugardb.io/docs/commands/generic/pexpire)
|
||||
* [PEXPIRETIME](https://sugardb.io/docs/commands/generic/pexpiretime)
|
||||
* [PTTL](https://sugardb.io/docs/commands/generic/pttl)
|
||||
* [RENAME](https://sugardb.io/docs/commands/generic/rename)
|
||||
* [SET](https://sugardb.io/docs/commands/generic/set)
|
||||
* [TTL](https://sugardb.io/docs/commands/generic/ttl)
|
||||
|
||||
<a name="commands-hash"></a>
|
||||
## HASH
|
||||
* [HDEL](https://echovault.io/docs/commands/hash/hdel)
|
||||
* [HEXISTS](https://echovault.io/docs/commands/hash/hexists)
|
||||
* [HGET](https://echovault.io/docs/commands/hash/hget)
|
||||
* [HGETALL](https://echovault.io/docs/commands/hash/hgetall)
|
||||
* [HINCRBY](https://echovault.io/docs/commands/hash/hincrby)
|
||||
* [HINCRBYFLOAT](https://echovault.io/docs/commands/hash/hincrbyfloat)
|
||||
* [HKEYS](https://echovault.io/docs/commands/hash/hkeys)
|
||||
* [HLEN](https://echovault.io/docs/commands/hash/hlen)
|
||||
* [HRANDFIELD](https://echovault.io/docs/commands/hash/hrandfield)
|
||||
* [HSET](https://echovault.io/docs/commands/hash/hset)
|
||||
* [HSETNX](https://echovault.io/docs/commands/hash/hsetnx)
|
||||
* [HSTRLEN](https://echovault.io/docs/commands/hash/hstrlen)
|
||||
* [HVALS](https://echovault.io/docs/commands/hash/hvals)
|
||||
* [HDEL](https://sugardb.io/docs/commands/hash/hdel)
|
||||
* [HEXISTS](https://sugardb.io/docs/commands/hash/hexists)
|
||||
* [HGET](https://sugardb.io/docs/commands/hash/hget)
|
||||
* [HGETALL](https://sugardb.io/docs/commands/hash/hgetall)
|
||||
* [HINCRBY](https://sugardb.io/docs/commands/hash/hincrby)
|
||||
* [HINCRBYFLOAT](https://sugardb.io/docs/commands/hash/hincrbyfloat)
|
||||
* [HKEYS](https://sugardb.io/docs/commands/hash/hkeys)
|
||||
* [HLEN](https://sugardb.io/docs/commands/hash/hlen)
|
||||
* [HRANDFIELD](https://sugardb.io/docs/commands/hash/hrandfield)
|
||||
* [HSET](https://sugardb.io/docs/commands/hash/hset)
|
||||
* [HSETNX](https://sugardb.io/docs/commands/hash/hsetnx)
|
||||
* [HSTRLEN](https://sugardb.io/docs/commands/hash/hstrlen)
|
||||
* [HVALS](https://sugardb.io/docs/commands/hash/hvals)
|
||||
|
||||
<a name="commands-list"></a>
|
||||
## LIST
|
||||
* [LINDEX](https://echovault.io/docs/commands/list/lindex)
|
||||
* [LLEN](https://echovault.io/docs/commands/list/llen)
|
||||
* [LMOVE](https://echovault.io/docs/commands/list/lmove)
|
||||
* [LPOP](https://echovault.io/docs/commands/list/lpop)
|
||||
* [LPUSH](https://echovault.io/docs/commands/list/lpush)
|
||||
* [LPUSHX](https://echovault.io/docs/commands/list/lpushx)
|
||||
* [LRANGE](https://echovault.io/docs/commands/list/lrange)
|
||||
* [LREM](https://echovault.io/docs/commands/list/lrem)
|
||||
* [LSET](https://echovault.io/docs/commands/list/lset)
|
||||
* [LTRIM](https://echovault.io/docs/commands/list/ltrim)
|
||||
* [RPOP](https://echovault.io/docs/commands/list/rpop)
|
||||
* [RPUSH](https://echovault.io/docs/commands/list/rpush)
|
||||
* [RPUSHX](https://echovault.io/docs/commands/list/rpushx)
|
||||
* [LINDEX](https://sugardb.io/docs/commands/list/lindex)
|
||||
* [LLEN](https://sugardb.io/docs/commands/list/llen)
|
||||
* [LMOVE](https://sugardb.io/docs/commands/list/lmove)
|
||||
* [LPOP](https://sugardb.io/docs/commands/list/lpop)
|
||||
* [LPUSH](https://sugardb.io/docs/commands/list/lpush)
|
||||
* [LPUSHX](https://sugardb.io/docs/commands/list/lpushx)
|
||||
* [LRANGE](https://sugardb.io/docs/commands/list/lrange)
|
||||
* [LREM](https://sugardb.io/docs/commands/list/lrem)
|
||||
* [LSET](https://sugardb.io/docs/commands/list/lset)
|
||||
* [LTRIM](https://sugardb.io/docs/commands/list/ltrim)
|
||||
* [RPOP](https://sugardb.io/docs/commands/list/rpop)
|
||||
* [RPUSH](https://sugardb.io/docs/commands/list/rpush)
|
||||
* [RPUSHX](https://sugardb.io/docs/commands/list/rpushx)
|
||||
|
||||
<a name="commands-pubsub"></a>
|
||||
## PUBSUB
|
||||
* [PSUBSCRIBE](https://echovault.io/docs/commands/pubsub/psubscribe)
|
||||
* [PUBLISH](https://echovault.io/docs/commands/pubsub/publish)
|
||||
* [PUBSUB CHANNELS](https://echovault.io/docs/commands/pubsub/pubsub_channels)
|
||||
* [PUBSUB NUMPAT](https://echovault.io/docs/commands/pubsub/pubsub_numpat)
|
||||
* [PUBSUB NUMSUB](https://echovault.io/docs/commands/pubsub/pubsub_numsub)
|
||||
* [PUNSUBSCRIBE](https://echovault.io/docs/commands/pubsub/punsubscribe)
|
||||
* [SUBSCRIBE](https://echovault.io/docs/commands/pubsub/subscribe)
|
||||
* [UNSUBSCRIBE](https://echovault.io/docs/commands/pubsub/unsubscribe)
|
||||
* [PSUBSCRIBE](https://sugardb.io/docs/commands/pubsub/psubscribe)
|
||||
* [PUBLISH](https://sugardb.io/docs/commands/pubsub/publish)
|
||||
* [PUBSUB CHANNELS](https://sugardb.io/docs/commands/pubsub/pubsub_channels)
|
||||
* [PUBSUB NUMPAT](https://sugardb.io/docs/commands/pubsub/pubsub_numpat)
|
||||
* [PUBSUB NUMSUB](https://sugardb.io/docs/commands/pubsub/pubsub_numsub)
|
||||
* [PUNSUBSCRIBE](https://sugardb.io/docs/commands/pubsub/punsubscribe)
|
||||
* [SUBSCRIBE](https://sugardb.io/docs/commands/pubsub/subscribe)
|
||||
* [UNSUBSCRIBE](https://sugardb.io/docs/commands/pubsub/unsubscribe)
|
||||
|
||||
<a name="commands-set"></a>
|
||||
## SET
|
||||
* [SADD](https://echovault.io/docs/commands/set/sadd)
|
||||
* [SCARD](https://echovault.io/docs/commands/set/scard)
|
||||
* [SDIFF](https://echovault.io/docs/commands/set/sdiff)
|
||||
* [SDIFFSTORE](https://echovault.io/docs/commands/set/sdiffstore)
|
||||
* [SINTER](https://echovault.io/docs/commands/set/sinter)
|
||||
* [SINTERCARD](https://echovault.io/docs/commands/set/sintercard)
|
||||
* [SINTERSTORE](https://echovault.io/docs/commands/set/sinterstore)
|
||||
* [SISMEMBER](https://echovault.io/docs/commands/set/sismember)
|
||||
* [SMEMBERS](https://echovault.io/docs/commands/set/smembers)
|
||||
* [SMISMEMBER](https://echovault.io/docs/commands/set/smismember)
|
||||
* [SMOVE](https://echovault.io/docs/commands/set/smove)
|
||||
* [SPOP](https://echovault.io/docs/commands/set/spop)
|
||||
* [SRANDMEMBER](https://echovault.io/docs/commands/set/srandmember)
|
||||
* [SREM](https://echovault.io/docs/commands/set/srem)
|
||||
* [SUNION](https://echovault.io/docs/commands/set/sunion)
|
||||
* [SUNIONSTORE](https://echovault.io/docs/commands/set/sunionstore)
|
||||
* [SADD](https://sugardb.io/docs/commands/set/sadd)
|
||||
* [SCARD](https://sugardb.io/docs/commands/set/scard)
|
||||
* [SDIFF](https://sugardb.io/docs/commands/set/sdiff)
|
||||
* [SDIFFSTORE](https://sugardb.io/docs/commands/set/sdiffstore)
|
||||
* [SINTER](https://sugardb.io/docs/commands/set/sinter)
|
||||
* [SINTERCARD](https://sugardb.io/docs/commands/set/sintercard)
|
||||
* [SINTERSTORE](https://sugardb.io/docs/commands/set/sinterstore)
|
||||
* [SISMEMBER](https://sugardb.io/docs/commands/set/sismember)
|
||||
* [SMEMBERS](https://sugardb.io/docs/commands/set/smembers)
|
||||
* [SMISMEMBER](https://sugardb.io/docs/commands/set/smismember)
|
||||
* [SMOVE](https://sugardb.io/docs/commands/set/smove)
|
||||
* [SPOP](https://sugardb.io/docs/commands/set/spop)
|
||||
* [SRANDMEMBER](https://sugardb.io/docs/commands/set/srandmember)
|
||||
* [SREM](https://sugardb.io/docs/commands/set/srem)
|
||||
* [SUNION](https://sugardb.io/docs/commands/set/sunion)
|
||||
* [SUNIONSTORE](https://sugardb.io/docs/commands/set/sunionstore)
|
||||
|
||||
<a name="commands-sortedset"></a>
|
||||
## SORTED SET
|
||||
* [ZADD](https://echovault.io/docs/commands/sorted_set/zadd)
|
||||
* [ZCARD](https://echovault.io/docs/commands/sorted_set/zcard)
|
||||
* [ZCOUNT](https://echovault.io/docs/commands/sorted_set/zcount)
|
||||
* [ZDIFF](https://echovault.io/docs/commands/sorted_set/zdiff)
|
||||
* [ZDIFFSTORE](https://echovault.io/docs/commands/sorted_set/zdiffstore)
|
||||
* [ZINCRBY](https://echovault.io/docs/commands/sorted_set/zincrby)
|
||||
* [ZINTER](https://echovault.io/docs/commands/sorted_set/zinter)
|
||||
* [ZINTERSTORE](https://echovault.io/docs/commands/sorted_set/zinterstore)
|
||||
* [ZLEXCOUNT](https://echovault.io/docs/commands/sorted_set/zlexcount)
|
||||
* [ZMPOP](https://echovault.io/docs/commands/sorted_set/zmpop)
|
||||
* [ZMSCORE](https://echovault.io/docs/commands/sorted_set/zmscore)
|
||||
* [ZPOPMAX](https://echovault.io/docs/commands/sorted_set/zpopmax)
|
||||
* [ZPOPMIN](https://echovault.io/docs/commands/sorted_set/zpopmin)
|
||||
* [ZRANDMEMBER](https://echovault.io/docs/commands/sorted_set/zrandmember)
|
||||
* [ZRANGE](https://echovault.io/docs/commands/sorted_set/zrange)
|
||||
* [ZRANGESTORE](https://echovault.io/docs/commands/sorted_set/zrangestore)
|
||||
* [ZRANK](https://echovault.io/docs/commands/sorted_set/zrank)
|
||||
* [ZREM](https://echovault.io/docs/commands/sorted_set/zrem)
|
||||
* [ZREMRANGEBYLEX](https://echovault.io/docs/commands/sorted_set/zremrangebylex)
|
||||
* [ZREMRANGEBYRANK](https://echovault.io/docs/commands/sorted_set/zremrangebyrank)
|
||||
* [ZREMRANGEBYSCORE](https://echovault.io/docs/commands/sorted_set/zremrangebyscore)
|
||||
* [ZREVRANK](https://echovault.io/docs/commands/sorted_set/zrevrank)
|
||||
* [ZSCORE](https://echovault.io/docs/commands/sorted_set/zscore)
|
||||
* [ZUNION](https://echovault.io/docs/commands/sorted_set/zunion)
|
||||
* [ZUNIONSTORE](https://echovault.io/docs/commands/sorted_set/zunionstore)
|
||||
* [ZADD](https://sugardb.io/docs/commands/sorted_set/zadd)
|
||||
* [ZCARD](https://sugardb.io/docs/commands/sorted_set/zcard)
|
||||
* [ZCOUNT](https://sugardb.io/docs/commands/sorted_set/zcount)
|
||||
* [ZDIFF](https://sugardb.io/docs/commands/sorted_set/zdiff)
|
||||
* [ZDIFFSTORE](https://sugardb.io/docs/commands/sorted_set/zdiffstore)
|
||||
* [ZINCRBY](https://sugardb.io/docs/commands/sorted_set/zincrby)
|
||||
* [ZINTER](https://sugardb.io/docs/commands/sorted_set/zinter)
|
||||
* [ZINTERSTORE](https://sugardb.io/docs/commands/sorted_set/zinterstore)
|
||||
* [ZLEXCOUNT](https://sugardb.io/docs/commands/sorted_set/zlexcount)
|
||||
* [ZMPOP](https://sugardb.io/docs/commands/sorted_set/zmpop)
|
||||
* [ZMSCORE](https://sugardb.io/docs/commands/sorted_set/zmscore)
|
||||
* [ZPOPMAX](https://sugardb.io/docs/commands/sorted_set/zpopmax)
|
||||
* [ZPOPMIN](https://sugardb.io/docs/commands/sorted_set/zpopmin)
|
||||
* [ZRANDMEMBER](https://sugardb.io/docs/commands/sorted_set/zrandmember)
|
||||
* [ZRANGE](https://sugardb.io/docs/commands/sorted_set/zrange)
|
||||
* [ZRANGESTORE](https://sugardb.io/docs/commands/sorted_set/zrangestore)
|
||||
* [ZRANK](https://sugardb.io/docs/commands/sorted_set/zrank)
|
||||
* [ZREM](https://sugardb.io/docs/commands/sorted_set/zrem)
|
||||
* [ZREMRANGEBYLEX](https://sugardb.io/docs/commands/sorted_set/zremrangebylex)
|
||||
* [ZREMRANGEBYRANK](https://sugardb.io/docs/commands/sorted_set/zremrangebyrank)
|
||||
* [ZREMRANGEBYSCORE](https://sugardb.io/docs/commands/sorted_set/zremrangebyscore)
|
||||
* [ZREVRANK](https://sugardb.io/docs/commands/sorted_set/zrevrank)
|
||||
* [ZSCORE](https://sugardb.io/docs/commands/sorted_set/zscore)
|
||||
* [ZUNION](https://sugardb.io/docs/commands/sorted_set/zunion)
|
||||
* [ZUNIONSTORE](https://sugardb.io/docs/commands/sorted_set/zunionstore)
|
||||
|
||||
<a name="commands-string"></a>
|
||||
## STRING
|
||||
* [GETRANGE](https://echovault.io/docs/commands/string/getrange)
|
||||
* [SETRANGE](https://echovault.io/docs/commands/string/setrange)
|
||||
* [STRLEN](https://echovault.io/docs/commands/string/strlen)
|
||||
* [SUBSTR](https://echovault.io/docs/commands/string/substr)
|
||||
* [GETRANGE](https://sugardb.io/docs/commands/string/getrange)
|
||||
* [SETRANGE](https://sugardb.io/docs/commands/string/setrange)
|
||||
* [STRLEN](https://sugardb.io/docs/commands/string/strlen)
|
||||
* [SUBSTR](https://sugardb.io/docs/commands/string/substr)
|
||||
|
||||
|
||||
|
||||
|
12
cmd/main.go
12
cmd/main.go
@@ -16,9 +16,9 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/echovault/echovault/echovault"
|
||||
"github.com/echovault/echovault/internal"
|
||||
"github.com/echovault/echovault/internal/config"
|
||||
"github.com/echovault/sugardb/internal"
|
||||
"github.com/echovault/sugardb/internal/config"
|
||||
"github.com/echovault/sugardb/sugardb"
|
||||
"log"
|
||||
"os"
|
||||
"os/signal"
|
||||
@@ -36,9 +36,9 @@ func main() {
|
||||
cancelCh := make(chan os.Signal, 1)
|
||||
signal.Notify(cancelCh, syscall.SIGINT, syscall.SIGTERM, os.Interrupt)
|
||||
|
||||
server, err := echovault.NewEchoVault(
|
||||
echovault.WithContext(ctx),
|
||||
echovault.WithConfig(conf),
|
||||
server, err := sugardb.NewSugarDB(
|
||||
sugardb.WithContext(ctx),
|
||||
sugardb.WithConfig(conf),
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
|
18678
coverage/coverage.out
18678
coverage/coverage.out
File diff suppressed because it is too large
Load Diff
@@ -13,12 +13,12 @@ services:
|
||||
- PORT=7480
|
||||
- DISCOVERY_PORT=7946
|
||||
- SERVER_ID=1
|
||||
- PLUGIN_DIR=/usr/local/lib/echovault
|
||||
- DATA_DIR=/var/lib/echovault
|
||||
- PLUGIN_DIR=/usr/local/lib/sugardb
|
||||
- DATA_DIR=/var/lib/sugardb
|
||||
- TLS=false
|
||||
- MTLS=false
|
||||
- BOOTSTRAP_CLUSTER=false
|
||||
- ACL_CONFIG=/etc/echovault/config/acl.yml
|
||||
- ACL_CONFIG=/etc/sugardb/config/acl.yml
|
||||
- REQUIRE_PASS=false
|
||||
- PASSWORD=password1
|
||||
- FORWARD_COMMAND=false
|
||||
@@ -31,11 +31,11 @@ services:
|
||||
- EVICTION_POLICY=noeviction
|
||||
- EVICTION_SAMPLE=20
|
||||
- EVICTION_INTERVAL=100ms
|
||||
# List of echovault cert/key pairs
|
||||
- CERT_KEY_PAIR_1=/etc/ssl/certs/echovault/server/server1.crt,/etc/ssl/certs/echovault/server/server1.key
|
||||
- CERT_KEY_PAIR_2=/etc/ssl/certs/echovault/server/server2.crt,/etc/ssl/certs/echovault/server/server2.key
|
||||
# List of sugardb cert/key pairs
|
||||
- CERT_KEY_PAIR_1=/etc/ssl/certs/sugardb/server/server1.crt,/etc/ssl/certs/sugardb/server/server1.key
|
||||
- CERT_KEY_PAIR_2=/etc/ssl/certs/sugardb/server/server2.crt,/etc/ssl/certs/sugardb/server/server2.key
|
||||
# List of client certificate authorities
|
||||
- CLIENT_CA_1=/etc/ssl/certs/echovault/client/rootCA.crt
|
||||
- CLIENT_CA_1=/etc/ssl/certs/sugardb/client/rootCA.crt
|
||||
# List of shared object plugins to load on startup
|
||||
- MODULE_1=./modules/module_set/module_set.so
|
||||
- MODULE_2=./modules/module_get/module_get.so
|
||||
@@ -43,8 +43,8 @@ services:
|
||||
- "7480:7480"
|
||||
- "7946:7946"
|
||||
volumes:
|
||||
- ./internal/volumes/config:/etc/echovault/config
|
||||
- ./internal/volumes/nodes/standalone_node:/var/lib/echovault
|
||||
- ./internal/volumes/config:/etc/sugardb/config
|
||||
- ./internal/volumes/nodes/standalone_node:/var/lib/sugardb
|
||||
networks:
|
||||
- testnet
|
||||
|
||||
@@ -59,11 +59,11 @@ services:
|
||||
- DISCOVERY_PORT=7946
|
||||
- SERVER_ID=1
|
||||
- JOIN_ADDR=2/cluster_node_2:7946
|
||||
- DATA_DIR=/var/lib/echovault
|
||||
- DATA_DIR=/var/lib/sugardb
|
||||
- TLS=false
|
||||
- MTLS=false
|
||||
- BOOTSTRAP_CLUSTER=true
|
||||
- ACL_CONFIG=/etc/echovault/config/acl.yml
|
||||
- ACL_CONFIG=/etc/sugardb/config/acl.yml
|
||||
- REQUIRE_PASS=false
|
||||
- FORWARD_COMMAND=true
|
||||
- SNAPSHOT_THRESHOLD=1000
|
||||
@@ -75,11 +75,11 @@ services:
|
||||
- EVICTION_POLICY=noeviction
|
||||
- EVICTION_SAMPLE=20
|
||||
- EVICTION_INTERVAL=100ms
|
||||
# List of echovault cert/key pairs
|
||||
- CERT_KEY_PAIR_1=/etc/ssl/certs/echovault/server/server1.crt,/etc/ssl/certs/echovault/server/server1.key
|
||||
- CERT_KEY_PAIR_2=/etc/ssl/certs/echovault/server/server2.crt,/etc/ssl/certs/echovault/server/server2.key
|
||||
# List of sugardb cert/key pairs
|
||||
- CERT_KEY_PAIR_1=/etc/ssl/certs/sugardb/server/server1.crt,/etc/ssl/certs/sugardb/server/server1.key
|
||||
- CERT_KEY_PAIR_2=/etc/ssl/certs/sugardb/server/server2.crt,/etc/ssl/certs/sugardb/server/server2.key
|
||||
# List of client certificate authorities
|
||||
- CLIENT_CA_1=/etc/ssl/certs/echovault/client/rootCA.crt
|
||||
- CLIENT_CA_1=/etc/ssl/certs/sugardb/client/rootCA.crt
|
||||
# List of shared object plugins to load on startup
|
||||
- MODULE_1=./modules/module_set/module_set.so
|
||||
- MODULE_2=./modules/module_get/module_get.so
|
||||
@@ -87,8 +87,8 @@ services:
|
||||
- "7481:7480"
|
||||
- "7945:7946"
|
||||
volumes:
|
||||
- ./internal/volumes/config:/etc/echovault/config
|
||||
- ./internal/volumes/nodes/cluster_node_1:/var/lib/echovault
|
||||
- ./internal/volumes/config:/etc/sugardb/config
|
||||
- ./internal/volumes/nodes/cluster_node_1:/var/lib/sugardb
|
||||
networks:
|
||||
- testnet
|
||||
|
||||
@@ -103,11 +103,11 @@ services:
|
||||
- DISCOVERY_PORT=7946
|
||||
- SERVER_ID=2
|
||||
- JOIN_ADDR=3/cluster_node_3:7946
|
||||
- DATA_DIR=/var/lib/echovault
|
||||
- DATA_DIR=/var/lib/sugardb
|
||||
- TLS=false
|
||||
- MTLS=false
|
||||
- BOOTSTRAP_CLUSTER=false
|
||||
- ACL_CONFIG=/etc/echovault/config/acl.yml
|
||||
- ACL_CONFIG=/etc/sugardb/config/acl.yml
|
||||
- REQUIRE_PASS=false
|
||||
- FORWARD_COMMAND=true
|
||||
- SNAPSHOT_THRESHOLD=1000
|
||||
@@ -119,11 +119,11 @@ services:
|
||||
- EVICTION_POLICY=noeviction
|
||||
- EVICTION_SAMPLE=20
|
||||
- EVICTION_INTERVAL=100ms
|
||||
# List of echovault cert/key pairs
|
||||
- CERT_KEY_PAIR_1=/etc/ssl/certs/echovault/server/server1.crt,/etc/ssl/certs/echovault/server/server1.key
|
||||
- CERT_KEY_PAIR_2=/etc/ssl/certs/echovault/server/server2.crt,/etc/ssl/certs/echovault/server/server2.key
|
||||
# List of sugardb cert/key pairs
|
||||
- CERT_KEY_PAIR_1=/etc/ssl/certs/sugardb/server/server1.crt,/etc/ssl/certs/sugardb/server/server1.key
|
||||
- CERT_KEY_PAIR_2=/etc/ssl/certs/sugardb/server/server2.crt,/etc/ssl/certs/sugardb/server/server2.key
|
||||
# List of client certificate authorities
|
||||
- CLIENT_CA_1=/etc/ssl/certs/echovault/client/rootCA.crt
|
||||
- CLIENT_CA_1=/etc/ssl/certs/sugardb/client/rootCA.crt
|
||||
# List of shared object plugins to load on startup
|
||||
- MODULE_1=./modules/module_set/module_set.so
|
||||
- MODULE_2=./modules/module_get/module_get.so
|
||||
@@ -131,8 +131,8 @@ services:
|
||||
- "7482:7480"
|
||||
- "7947:7946"
|
||||
volumes:
|
||||
- ./internal/volumes/config:/etc/echovault/config
|
||||
- ./internal/volumes/nodes/cluster_node_2:/var/lib/echovault
|
||||
- ./internal/volumes/config:/etc/sugardb/config
|
||||
- ./internal/volumes/nodes/cluster_node_2:/var/lib/sugardb
|
||||
networks:
|
||||
- testnet
|
||||
|
||||
@@ -147,11 +147,11 @@ services:
|
||||
- DISCOVERY_PORT=7946
|
||||
- SERVER_ID=3
|
||||
- JOIN_ADDR=4/cluster_node_4:7946
|
||||
- DATA_DIR=/var/lib/echovault
|
||||
- DATA_DIR=/var/lib/sugardb
|
||||
- TLS=false
|
||||
- MTLS=false
|
||||
- BOOTSTRAP_CLUSTER=false
|
||||
- ACL_CONFIG=/etc/echovault/config/acl.yml
|
||||
- ACL_CONFIG=/etc/sugardb/config/acl.yml
|
||||
- REQUIRE_PASS=false
|
||||
- FORWARD_COMMAND=true
|
||||
- SNAPSHOT_THRESHOLD=1000
|
||||
@@ -163,11 +163,11 @@ services:
|
||||
- EVICTION_POLICY=noeviction
|
||||
- EVICTION_SAMPLE=20
|
||||
- EVICTION_INTERVAL=100ms
|
||||
# List of echovault cert/key pairs
|
||||
- CERT_KEY_PAIR_1=/etc/ssl/certs/echovault/server/server1.crt,/etc/ssl/certs/echovault/server/server1.key
|
||||
- CERT_KEY_PAIR_2=/etc/ssl/certs/echovault/server/server2.crt,/etc/ssl/certs/echovault/server/server2.key
|
||||
# List of sugardb cert/key pairs
|
||||
- CERT_KEY_PAIR_1=/etc/ssl/certs/sugardb/server/server1.crt,/etc/ssl/certs/sugardb/server/server1.key
|
||||
- CERT_KEY_PAIR_2=/etc/ssl/certs/sugardb/server/server2.crt,/etc/ssl/certs/sugardb/server/server2.key
|
||||
# List of client certificate authorities
|
||||
- CLIENT_CA_1=/etc/ssl/certs/echovault/client/rootCA.crt
|
||||
- CLIENT_CA_1=/etc/ssl/certs/sugardb/client/rootCA.crt
|
||||
# List of shared object plugins to load on startup
|
||||
- MODULE_1=./modules/module_set/module_set.so
|
||||
- MODULE_2=./modules/module_get/module_get.so
|
||||
@@ -175,8 +175,8 @@ services:
|
||||
- "7483:7480"
|
||||
- "7948:7946"
|
||||
volumes:
|
||||
- ./internal/volumes/config:/etc/echovault/config
|
||||
- ./internal/volumes/nodes/cluster_node_3:/var/lib/echovault
|
||||
- ./internal/volumes/config:/etc/sugardb/config
|
||||
- ./internal/volumes/nodes/cluster_node_3:/var/lib/sugardb
|
||||
networks:
|
||||
- testnet
|
||||
|
||||
@@ -191,11 +191,11 @@ services:
|
||||
- DISCOVERY_PORT=7946
|
||||
- SERVER_ID=4
|
||||
- JOIN_ADDR=5/cluster_node_5:7946
|
||||
- DATA_DIR=/var/lib/echovault
|
||||
- DATA_DIR=/var/lib/sugardb
|
||||
- TLS=false
|
||||
- MTLS=false
|
||||
- BOOTSTRAP_CLUSTER=false
|
||||
- ACL_CONFIG=/etc/echovault/config/acl.yml
|
||||
- ACL_CONFIG=/etc/sugardb/config/acl.yml
|
||||
- REQUIRE_PASS=false
|
||||
- FORWARD_COMMAND=true
|
||||
- SNAPSHOT_THRESHOLD=1000
|
||||
@@ -207,11 +207,11 @@ services:
|
||||
- EVICTION_POLICY=noeviction
|
||||
- EVICTION_SAMPLE=20
|
||||
- EVICTION_INTERVAL=100ms
|
||||
# List of echovault cert/key pairs
|
||||
- CERT_KEY_PAIR_1=/etc/ssl/certs/echovault/server/server1.crt,/etc/ssl/certs/echovault/server/server1.key
|
||||
- CERT_KEY_PAIR_2=/etc/ssl/certs/echovault/server/server2.crt,/etc/ssl/certs/echovault/server/server2.key
|
||||
# List of sugardb cert/key pairs
|
||||
- CERT_KEY_PAIR_1=/etc/ssl/certs/sugardb/server/server1.crt,/etc/ssl/certs/sugardb/server/server1.key
|
||||
- CERT_KEY_PAIR_2=/etc/ssl/certs/sugardb/server/server2.crt,/etc/ssl/certs/sugardb/server/server2.key
|
||||
# List of client certificate authorities
|
||||
- CLIENT_CA_1=/etc/ssl/certs/echovault/client/rootCA.crt
|
||||
- CLIENT_CA_1=/etc/ssl/certs/sugardb/client/rootCA.crt
|
||||
# List of shared object plugins to load on startup
|
||||
- MODULE_1=./modules/module_set/module_set.so
|
||||
- MODULE_2=./modules/module_get/module_get.so
|
||||
@@ -219,8 +219,8 @@ services:
|
||||
- "7484:7480"
|
||||
- "7949:7946"
|
||||
volumes:
|
||||
- ./internal/volumes/config:/etc/echovault/config
|
||||
- ./internal/volumes/nodes/cluster_node_4:/var/lib/echovault
|
||||
- ./internal/volumes/config:/etc/sugardb/config
|
||||
- ./internal/volumes/nodes/cluster_node_4:/var/lib/sugardb
|
||||
networks:
|
||||
- testnet
|
||||
|
||||
@@ -235,11 +235,11 @@ services:
|
||||
- DISCOVERY_PORT=7946
|
||||
- SERVER_ID=5
|
||||
- JOIN_ADDR=1/cluster_node_1:7946
|
||||
- DATA_DIR=/var/lib/echovault
|
||||
- DATA_DIR=/var/lib/sugardb
|
||||
- TLS=false
|
||||
- MTLS=false
|
||||
- BOOTSTRAP_CLUSTER=false
|
||||
- ACL_CONFIG=/etc/echovault/config/acl.yml
|
||||
- ACL_CONFIG=/etc/sugardb/config/acl.yml
|
||||
- REQUIRE_PASS=false
|
||||
- FORWARD_COMMAND=true
|
||||
- SNAPSHOT_THRESHOLD=1000
|
||||
@@ -251,11 +251,11 @@ services:
|
||||
- EVICTION_POLICY=noeviction
|
||||
- EVICTION_SAMPLE=20
|
||||
- EVICTION_INTERVAL=100ms
|
||||
# List of echovault cert/key pairs
|
||||
- CERT_KEY_PAIR_1=/etc/ssl/certs/echovault/server/server1.crt,/etc/ssl/certs/echovault/server/server1.key
|
||||
- CERT_KEY_PAIR_2=/etc/ssl/certs/echovault/server/server2.crt,/etc/ssl/certs/echovault/server/server2.key
|
||||
# List of sugardb cert/key pairs
|
||||
- CERT_KEY_PAIR_1=/etc/ssl/certs/sugardb/server/server1.crt,/etc/ssl/certs/sugardb/server/server1.key
|
||||
- CERT_KEY_PAIR_2=/etc/ssl/certs/sugardb/server/server2.crt,/etc/ssl/certs/sugardb/server/server2.key
|
||||
# List of client certificate authorities
|
||||
- CLIENT_CA_1=/etc/ssl/certs/echovault/client/rootCA.crt
|
||||
- CLIENT_CA_1=/etc/ssl/certs/sugardb/client/rootCA.crt
|
||||
# List of shared object plugins to load on startup
|
||||
- MODULE_1=./modules/module_set/module_set.so
|
||||
- MODULE_2=./modules/module_get/module_get.so
|
||||
@@ -263,7 +263,7 @@ services:
|
||||
- "7485:7480"
|
||||
- "7950:7946"
|
||||
volumes:
|
||||
- ./internal/volumes/config:/etc/echovault/config
|
||||
- ./internal/volumes/nodes/cluster_node_5:/var/lib/echovault
|
||||
- ./internal/volumes/config:/etc/sugardb/config
|
||||
- ./internal/volumes/nodes/cluster_node_5:/var/lib/sugardb
|
||||
networks:
|
||||
- testnet
|
@@ -1 +1 @@
|
||||
echovault.io
|
||||
.io
|
@@ -4,9 +4,9 @@ sidebar_position: 7
|
||||
|
||||
# Access Control List
|
||||
|
||||
Access Control Lists enable you to add a layer of security to the EchoVault server or cluster. You can create users with associated rules and require clients to authorize before executing commands on the server.
|
||||
Access Control Lists enable you to add a layer of security to the SugarDB server or cluster. You can create users with associated rules and require clients to authorize before executing commands on the server.
|
||||
|
||||
EchoVault creates a default user upon startup. You can see this user by executing the following command:
|
||||
SugarDB creates a default user upon startup. You can see this user by executing the following command:
|
||||
|
||||
```
|
||||
> ACL LIST
|
||||
@@ -17,7 +17,7 @@ The default user is enabled, and has access to all categories, commands, keys an
|
||||
|
||||
You can configure the default user to require a passwords by using the following configuration options:
|
||||
|
||||
- `--require-pass` forces the EchoVault server to require a user to authenticate itself using a password and/or username.
|
||||
- `--require-pass` forces the SugarDB server to require a user to authenticate itself using a password and/or username.
|
||||
|
||||
- `--password` attaches the provided password to the default user.
|
||||
|
||||
@@ -29,7 +29,7 @@ The TCP client can authenticate itself using the `AUTH` command:
|
||||
|
||||
`AUTH <password>` tries to authenticate the TCP connection with the default user and the provided passsword.
|
||||
|
||||
Authorization is not supported in embedded mode. When an EchoVault instance is embedded, it autimatically has access to all the commands exposed by the API.
|
||||
Authorization is not supported in embedded mode. When an SugarDB instance is embedded, it autimatically has access to all the commands exposed by the API.
|
||||
|
||||
## Configuration files
|
||||
|
||||
@@ -157,9 +157,9 @@ The `nocommands` flag will apply the `-all` rule.
|
||||
|
||||
### Allow and disallow access to keys
|
||||
|
||||
By default, EchoVault allows each user to read and write to all keys. If you'd like to control what keys users have access to and what they can do with those keys, you can make use of the following options:
|
||||
By default, SugarDB allows each user to read and write to all keys. If you'd like to control what keys users have access to and what they can do with those keys, you can make use of the following options:
|
||||
|
||||
- `%RW~*` - Allow this user to read and write all keys on the EchoVault isntance (aliased by `allKeys`).
|
||||
- `%RW~*` - Allow this user to read and write all keys on the SugarDB instance (aliased by `allKeys`).
|
||||
- `%RW~<key>` - Allow this user to read and write to the specified key. This option accepts a glob pattern for the key which allows you to restrict certain key patterns.
|
||||
- `%W~*` - Allow the user to write to all keys.
|
||||
- `%W~<key>` - Block the user from writing to any keys except the one specified. A glob pattern can be used in place of the key.
|
||||
|
@@ -4,7 +4,7 @@ sidebar_position: 6
|
||||
|
||||
# Architecture
|
||||
|
||||
EchoVault can be run in the following modes:
|
||||
SugarDB can be run in the following modes:
|
||||
|
||||
- Standalone mode - Where only one instance runs in isolation.
|
||||
- Replication cluster - Strongly consistent RAFT cluster.
|
||||
|
@@ -29,20 +29,20 @@ Lists all the categories. If the optional category is provided, lists all the co
|
||||
<TabItem value="go">
|
||||
List all categories:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
categories, err := vault.ACLCat()
|
||||
categories, err := db.ACLCat()
|
||||
```
|
||||
|
||||
List all commands/subcommands in pubsub module:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
commands, err := vault.ACLCat("pubsub")
|
||||
commands, err := db.ACLCat("pubsub")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Deletes users and terminates their connections. This command cannot delete the d
|
||||
<TabItem value="go">
|
||||
Delete users:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
ok, err := vault.ACLDelUser("username1", "username2")
|
||||
ok, err := db.ACLDelUser("username1", "username2")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ List the ACL rules of a user.
|
||||
<TabItem value="go">
|
||||
Retrieve user:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
rules, err := vault.ACLGetUser("username")
|
||||
rules, err := db.ACLGetUser("username")
|
||||
```
|
||||
|
||||
Returns a map[string][]string map where each key is the rule category and each value is a string slice of relevant values.
|
||||
|
@@ -31,11 +31,11 @@ Dumps effective acl rules in ACL DSL format.
|
||||
<TabItem value="go">
|
||||
List ACL rules:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
rules, err := vault.ACLList()
|
||||
rules, err := db.ACLList()
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -33,15 +33,15 @@ When 'REPLACE' is passed, users from config file who share a username with users
|
||||
<TabItem value="go">
|
||||
Load ACL config:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
// Load config and merge with currently loaded ACL config
|
||||
ok, err := vault.ACLLoad(echovault.ACLLoadOptions{Merge: true})
|
||||
ok, err := db.ACLLoad(sugardb.ACLLoadOptions{Merge: true})
|
||||
|
||||
// Load config and replace currently loaded ACL config
|
||||
ok, err := vault.ACLLoad(echovault.ACLLoadOptions{Replace: true})`
|
||||
ok, err := db.ACLLoad(sugardb.ACLLoadOptions{Replace: true})`
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -33,7 +33,7 @@ in-memory ACL configuration.
|
||||
<TabItem value="go">
|
||||
Save ACL rules:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
@@ -31,11 +31,11 @@ Configure a new or existing user.
|
||||
<TabItem value="go">
|
||||
Save user:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
user := echovault.User{}
|
||||
user := sugardb.User{}
|
||||
ok, err := server.ACLSetUser(user)
|
||||
```
|
||||
|
||||
|
@@ -31,11 +31,11 @@ Lists all usernames of the configured ACL users.
|
||||
<TabItem value="go">
|
||||
List ACL usernames:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
users, err := vault.ACLUsers()
|
||||
users, err := db.ACLUsers()
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -16,7 +16,7 @@ COMMAND COUNT
|
||||
<span className="acl-category">slow</span>
|
||||
|
||||
### Description
|
||||
Get the dumber of commands in the echovault instance.
|
||||
Get the number of commands in the SugarDB instance.
|
||||
|
||||
### Examples
|
||||
|
||||
@@ -30,11 +30,11 @@ Get the dumber of commands in the echovault instance.
|
||||
<TabItem value="go">
|
||||
Get server command count:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
count, err := vault.CommandCount()
|
||||
count, err := db.CommandCount()
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -22,7 +22,7 @@ Get the list of command names. Allows for filtering by ACL category or glob patt
|
||||
|
||||
FILTERBY - An optional condition used to filter the response. ACLCAT filters by the provided acl
|
||||
category string. PATTERN filters the response by the provided glob pattern.
|
||||
MODULE filters the response by the provided EchoVault module.
|
||||
MODULE filters the response by the provided SugarDB module.
|
||||
|
||||
### Examples
|
||||
|
||||
@@ -36,38 +36,38 @@ MODULE filters the response by the provided EchoVault module.
|
||||
<TabItem value="go">
|
||||
Get a list of all the loaded commands:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
commands, err := vault.CommandList(echovault.CommandListOptions{})
|
||||
commands, err := db.CommandList(sugardb.CommandListOptions{})
|
||||
```
|
||||
|
||||
Get a list of all commands with the \"fast\" ACL category:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
commands, err := vault.CommandList(echovault.CommandListOptions{ACLCAT: "fast"})
|
||||
commands, err := db.CommandList(sugardb.CommandListOptions{ACLCAT: "fast"})
|
||||
```
|
||||
|
||||
Get a list of all commands which satisfy the \"z*\" glob pattern:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
commands, err := vault.CommandList(echovault.CommandListOptions{PATTERN: "z*"})
|
||||
commands, err := db.CommandList(sugardb.CommandListOptions{PATTERN: "z*"})
|
||||
```
|
||||
|
||||
Get a list of all the commands in the \"set\" module:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
commands, err := vault.CommandList(echovault.CommandListOptions{MODULE: "set"})
|
||||
commands, err := db.CommandList(sugardb.CommandListOptions{MODULE: "set"})
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -16,8 +16,8 @@ COMMANDS
|
||||
<span className="acl-category">slow</span>
|
||||
|
||||
### Description
|
||||
Get a list of all the commands in available on the echovault with categories and descriptions.
|
||||
Sub-commmands are formated as "command|subcommand".
|
||||
Get a list of all the commands in available on the SugarDB instance with categories and descriptions.
|
||||
Sub-commands are formatted as "command|subcommand".
|
||||
|
||||
### Examples
|
||||
|
||||
|
@@ -31,11 +31,11 @@ Get unix timestamp for the latest snapshot in milliseconds.
|
||||
<TabItem value="go">
|
||||
Get last snapshot timestamp:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
count, err := vault.LastSave()
|
||||
count, err := db.LastSave()
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -17,7 +17,7 @@ MODULE LIST
|
||||
<span className="acl-category">fast</span>
|
||||
|
||||
### Description
|
||||
List all the modules that are currently loaded in the server.
|
||||
List all the modules that are currently loaded in the server/instance.
|
||||
|
||||
### Examples
|
||||
|
||||
@@ -29,13 +29,13 @@ List all the modules that are currently loaded in the server.
|
||||
]}
|
||||
>
|
||||
<TabItem value="go">
|
||||
List all the modules that are currently loaded in the server:
|
||||
List all the modules that are currently loaded in the instance:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
modules := server.ListModules()
|
||||
modules := db.ListModules()
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -18,7 +18,7 @@ MODULE LOAD path [arg [arg ...]]
|
||||
|
||||
### Description
|
||||
Load a module from a dynamic library at runtime.
|
||||
The path should be the full path to the module, including the .so filename. Any args will be be passed unmodified to the
|
||||
The path should be the full path to the module, including the .so filename. Any args will be passed unmodified to the
|
||||
module's key extraction and handler functions.
|
||||
|
||||
### Examples
|
||||
@@ -33,7 +33,7 @@ module's key extraction and handler functions.
|
||||
<TabItem value="go">
|
||||
Load a modules with no args:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -42,7 +42,7 @@ module's key extraction and handler functions.
|
||||
|
||||
Load a module with a few args:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
@@ -31,7 +31,7 @@ Unloads a module based on the its name as displayed by the MODULE LIST command.
|
||||
<TabItem value="go">
|
||||
Unload a module:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
@@ -31,11 +31,11 @@ Trigger re-writing of append process.
|
||||
<TabItem value="go">
|
||||
Trigger re-writing of append process:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
count, err := vault.RewriteAOF()
|
||||
count, err := db.RewriteAOF()
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Trigger a snapshot save.
|
||||
<TabItem value="go">
|
||||
Trigger a snapshot save:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
count, err := vault.Save()
|
||||
count, err := db.Save()
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -39,11 +39,11 @@ This command returns a contextual client report.
|
||||
the SetProtocol method:
|
||||
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
err := vault.SetProtocol(2)
|
||||
err := db.SetProtocol(2)
|
||||
```
|
||||
|
||||
The method above changes the protocol to version 3. This is relevant when executing commands using the
|
||||
|
@@ -16,7 +16,7 @@ PING [message]
|
||||
<span className="acl-category">fast</span>
|
||||
|
||||
### Description
|
||||
Ping the echovault server. If a message is provided, the message will be echoed back to the client.
|
||||
Ping the SugarDB server. If a message is provided, the message will be echoed back to the client.
|
||||
Otherwise, the server will return "PONG".
|
||||
|
||||
### Examples
|
||||
|
@@ -32,11 +32,11 @@ When this command is executed in a RAFT cluster, the database will be created in
|
||||
<TabItem value="go">
|
||||
Select the database that the embedded instance is operating from:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
err := vault.SelectDB(2)
|
||||
err := db.SelectDB(2)
|
||||
```
|
||||
After successfully calling this method, all subsequent commands executed on that instance
|
||||
will be executed on the selected database. So you should to be careful when doing this in a multi-threaded environment.
|
||||
|
@@ -34,14 +34,14 @@ and the other way around. If either one of the databases does not exist, it will
|
||||
<TabItem value="go">
|
||||
Swap the databases with indexes 1 and 2:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
err := vault.SwapDBs(1, 2)
|
||||
err := db.SwapDBs(1, 2)
|
||||
```
|
||||
The method above only switches the databases for the currently active TCP connections.
|
||||
To switch the database for the embeded instance, use the `SelectDB` method.
|
||||
To switch the database for the embedded instance, use the `SelectDB` method.
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
Swap the databases with indexes 1 and 2:
|
||||
|
@@ -34,11 +34,11 @@ This operation is limited to 64 bit signed integers.
|
||||
<TabItem value="go">
|
||||
Decrement the value of the key `mykey`:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
value, err := vault.Decr("mykey")
|
||||
value, err := db.Decr("mykey")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -32,11 +32,11 @@ If the key's value is not of the correct type or cannot be represented as an int
|
||||
<TabItem value="go">
|
||||
Decrement the value of the key `mykey` by 5:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
value, err := vault.DecrBy("mykey 5")
|
||||
value, err := db.DecrBy("mykey 5")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,20 +31,20 @@ Removes one or more keys from the store.
|
||||
<TabItem value="go">
|
||||
Delete a single key:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
noOfDeletedKeys, err = vault.Del("key1")
|
||||
noOfDeletedKeys, err = db.Del("key1")
|
||||
```
|
||||
|
||||
Delete multiple keys:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
noOfDeletedKeys, err = vault.Del("key1", "key2", "key3")
|
||||
noOfDeletedKeys, err = db.Del("key1", "key2", "key3")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -48,38 +48,38 @@ NX, GT, and LT are mutually exclusive. XX can additionally be passed in with eit
|
||||
<br></br>
|
||||
Add an expiration to a key:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
ok, err := vault.Expire("key", 10, nil)
|
||||
ok, err := db.Expire("key", 10, nil)
|
||||
```
|
||||
|
||||
Add an expiration to a key only if it does not have one already:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
ok, err := vault.Expire("key", 10, echovault.NX)
|
||||
ok, err := db.Expire("key", 10, sugardb.NX)
|
||||
```
|
||||
|
||||
Add an expiration to a key only if it has one already:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
ok, err := vault.Expire("key", 10, echovault.XX)
|
||||
ok, err := db.Expire("key", 10, sugardb.XX)
|
||||
```
|
||||
|
||||
Add an expiration to a key only if it already has one that is less than the current expiry:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
ok, err := vault.Expire("key", 10, echovault.XX, echovault.LT)
|
||||
ok, err := db.Expire("key", 10, sugardb.XX, sugardb.LT)
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -48,38 +48,38 @@ NX, GT, and LT are mutually exclusive. XX can additionally be passed in with eit
|
||||
<br></br>
|
||||
Add an expiration to a key:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
ok, err := vault.Expire("key", 1767160800, nil)
|
||||
ok, err := db.Expire("key", 1767160800, nil)
|
||||
```
|
||||
|
||||
Add an expiration to a key only if it does not have one already:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
ok, err := vault.Expire("key", 1767160800, echovault.NX)
|
||||
ok, err := db.Expire("key", 1767160800, sugardb.NX)
|
||||
```
|
||||
|
||||
Add an expiration to a key only if it has one already:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
ok, err := vault.Expire("key", 1767160800, echovault.XX)
|
||||
ok, err := db.Expire("key", 1767160800, sugardb.XX)
|
||||
```
|
||||
|
||||
Add an expiration to a key only if it already has one that is less than the current expiry:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
ok, err := vault.Expire("key", 1767160800, echovault.XX, echovault.LT)
|
||||
ok, err := db.Expire("key", 1767160800, sugardb.XX, sugardb.LT)
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Returns the absolute unix time in seconds when the key will expire.
|
||||
<TabItem value="go">
|
||||
Get the expiration time of a key:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
expireTime, err := vault.ExpireTime("key")
|
||||
expireTime, err := db.ExpireTime("key")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -32,11 +32,11 @@ Delete all the keys in all the existing databases. This command is always synchr
|
||||
<TabItem value="go">
|
||||
In order to delete all the keys in all the databases, you need to pass -1 to the `Flush` method:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
vault.Flush(-1)
|
||||
db.Flush(-1)
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -32,11 +32,11 @@ Delete all the keys in the currently selected database. This command is always s
|
||||
<TabItem value="go">
|
||||
For the embedded instance, you need to pass the database index to the `Flush` method:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
vault.Flush(0)
|
||||
db.Flush(0)
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Get the value at the specified key.
|
||||
<TabItem value="go">
|
||||
Get the value at the specified key:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
value, err := vault.Get("key")
|
||||
value, err := db.Get("key")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -32,11 +32,11 @@ This operation is limited to 64 bit signed integers.
|
||||
<TabItem value="go">
|
||||
Increment the value of the key `mykey`:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
value, err := vault.Incr("mykey")
|
||||
value, err := db.Incr("mykey")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -16,8 +16,9 @@ INCRBY key increment
|
||||
<span className="acl-category">write</span>
|
||||
|
||||
### Description
|
||||
Increments the number stored at key by increment. If the key does not exist, it is set to 0 before performing the operation.
|
||||
An error is returned if the key contains a value of the wrong type or contains a string that can not be represented as integer.
|
||||
Increments the number stored at key by increment. If the key does not exist, it is set to 0 before performing
|
||||
the operation. An error is returned if the key contains a value of the wrong type or contains a string
|
||||
that can not be represented as integer.
|
||||
|
||||
### Options
|
||||
|
||||
@@ -33,11 +34,11 @@ An error is returned if the key contains a value of the wrong type or contains a
|
||||
<TabItem value="go">
|
||||
Increment the value of the key `mykey` by 5:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
value, err := vault.IncrBy("mykey", "5")
|
||||
value, err := db.IncrBy("mykey", "5")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Get multiple values from the specified keys.
|
||||
<TabItem value="go">
|
||||
Get the values at the specified keys:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
values, err := vault.MGet("key1", "key2", "key3")
|
||||
values, err := db.MGet("key1", "key2", "key3")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -30,11 +30,11 @@ Set or modify multiple key/value pairs at once.
|
||||
<TabItem value="go">
|
||||
Set multiple key/value pairs:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
ok, err := vault.MSet(map[string]string{"key1": "value1", "key2": "value2", "key3": "value3"})
|
||||
ok, err := db.MSet(map[string]string{"key1": "value1", "key2": "value2", "key3": "value3"})
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -33,11 +33,11 @@ This command returns an integer representing the access frequency. If the key do
|
||||
<TabItem value="go">
|
||||
Get a key's access frequency:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
freq, err := vault.ObjectFreq("key")
|
||||
freq, err := db.ObjectFreq("key")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -34,11 +34,11 @@ and an error is returned.
|
||||
<TabItem value="go">
|
||||
Get a key's idle time:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
idletime, err := vault.ObjectIdleTime("key")
|
||||
idletime, err := db.ObjectIdleTime("key")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Removes the TTl associated with a key, turning it from a volatile key to a persi
|
||||
<TabItem value="go">
|
||||
Remove the TTL associated with a key:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
ok, err := vault.Persist("key")
|
||||
ok, err := db.Persist("key")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -45,38 +45,38 @@ Expire the key in the specified number of milliseconds. This commands turns a ke
|
||||
<br></br>
|
||||
Add an expiration to a key:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
updated, err := vault.PExpire("key", 10000, nil)
|
||||
updated, err := db.PExpire("key", 10000, nil)
|
||||
```
|
||||
|
||||
Add an expiration to a key only if it does not have one already:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
updated, err := vault.PExpire("key", 10000, echovault.NX)
|
||||
updated, err := db.PExpire("key", 10000, db.NX)
|
||||
```
|
||||
|
||||
Add an expiration to a key only if it has one already:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
updated, err := vault.PExpire("key", 10000, echovault.XX)
|
||||
updated, err := db.PExpire("key", 10000, db.XX)
|
||||
```
|
||||
|
||||
Add an expiration to a key only if it already has one that is less than the current expiry:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
updated, err := vault.PExpire("key", 10000, echovault.XX, echovault.LT)
|
||||
updated, err := db.PExpire("key", 10000, db.XX, db.LT)
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -48,38 +48,38 @@ NX, GT, and LT are mutually exclusive. XX can additionally be passed in with eit
|
||||
<br></br>
|
||||
Add an expiration to a key:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
ok, err := vault.Expire("key", 1767160800000, nil)
|
||||
ok, err := db.Expire("key", 1767160800000, nil)
|
||||
```
|
||||
|
||||
Add an expiration to a key only if it does not have one already:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
ok, err := vault.Expire("key", 1767160800000, echovault.NX)
|
||||
ok, err := db.Expire("key", 1767160800000, db.NX)
|
||||
```
|
||||
|
||||
Add an expiration to a key only if it has one already:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
ok, err := vault.Expire("key", 1767160800000, echovault.XX)
|
||||
ok, err := db.Expire("key", 1767160800000, db.XX)
|
||||
```
|
||||
|
||||
Add an expiration to a key only if it already has one that is less than the current expiry:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
ok, err := vault.Expire("key", 1767160800000, echovault.XX, echovault.LT)
|
||||
ok, err := db.Expire("key", 1767160800000, db.XX, db.LT)
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -34,11 +34,11 @@ Returns -2 if the key does not exist.
|
||||
<TabItem value="go">
|
||||
Retrieve the expiration time of a key:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
pexpireTime, err := vault.PExpireTime("key")
|
||||
pexpireTime, err := db.PExpireTime("key")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -33,11 +33,11 @@ If the key does not exist, -2 is returned.
|
||||
<TabItem value="go">
|
||||
Retrieve the expiration time of a key:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
ttl, err := vault.PTTL("key")
|
||||
ttl, err := db.PTTL("key")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -30,11 +30,11 @@ Renames key to newkey. If newkey already exists, it is overwritten. If key does
|
||||
<TabItem value="go">
|
||||
Rename the key `mykey` to `newkey`:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
err = vault.Rename("mykey", "newkey")
|
||||
err = db.Rename("mykey", "newkey")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -63,59 +63,59 @@ Set the value of a key, considering the value's type. If the key already exists,
|
||||
<br></br>
|
||||
Set a value at a key:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
ok, err := vault.Set("name", "EchoVault", echovault.SETOptions{})
|
||||
ok, err := db.Set("name", "SugarDB", db.SETOptions{})
|
||||
```
|
||||
|
||||
Set a value only if the key does not exist:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
ok, err := vault.Set("name", "EchoVault", echovault.SETOptions{WriteOpt: echovault.SETNX})
|
||||
ok, err := db.Set("name", "SugarDB", db.SETOptions{WriteOpt: db.SETNX})
|
||||
```
|
||||
|
||||
Set a value if key already exists and get the previous value:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
previousValue, err := vault.Set("name", "EchoVault", echovault.SetOptions{WriteOpt: echovault.SETXX, Get: true})
|
||||
previousValue, err := db.Set("name", "SugarDB", db.SetOptions{WriteOpt: db.SETXX, Get: true})
|
||||
```
|
||||
|
||||
Set a value if the key already exists, return the previous value, and expire after 10 seconds:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
previousValue, err := vault.Set("name", "EchoVault", echovault.SetOptions{WriteOpt: echovault.SETXX, ExpireOpt: echovault.SETEX, ExpireTime 10, Get: true})
|
||||
previousValue, err := db.Set("name", "SugarDB", db.SetOptions{WriteOpt: db.SETXX, ExpireOpt: db.SETEX, ExpireTime 10, Get: true})
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
Set a value at a key:
|
||||
```
|
||||
> SET name EchoVault
|
||||
> SET name SugarDB
|
||||
```
|
||||
|
||||
Set a value only if the key does not exist:
|
||||
```
|
||||
> SET name EchoVault NX
|
||||
> SET name SugarDB NX
|
||||
```
|
||||
|
||||
Set a value if key already exists and get the previous value:
|
||||
```
|
||||
> SET name EchoVault XX GET
|
||||
> SET name SugarDB XX GET
|
||||
```
|
||||
|
||||
Set a value if the key already exists, return the previous value, and expire after 10 seconds:
|
||||
```
|
||||
> SET name EchoVault XX GET EX 10
|
||||
> SET name SugarDB XX GET EX 10
|
||||
```
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
@@ -32,20 +32,20 @@ A key is ignored if it does not exist. This commands returns the number of keys
|
||||
<TabItem value="go">
|
||||
Touch a key:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
touched, err := vault.Touch("key1")
|
||||
touched, err := db.Touch("key1")
|
||||
```
|
||||
|
||||
Touch multiple keys:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
touched, err := vault.Touch("key1", "key2", "key3")
|
||||
touched, err := db.Touch("key1", "key2", "key3")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -33,11 +33,11 @@ If the key does not exist, -2 is returned.
|
||||
<TabItem value="go">
|
||||
Retrieve the expiration time of a key:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
ttl, err := vault.TTL("key")
|
||||
ttl, err := db.TTL("key")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -32,11 +32,11 @@ Deletes the specified fields from the hash.
|
||||
<TabItem value="go">
|
||||
Delete fields from a hash:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
deletedCount, err := vault.HDel("key", "field1", "field2")
|
||||
deletedCount, err := db.HDel("key", "field1", "field2")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -32,11 +32,11 @@ Returns if field is an existing field in the hash.
|
||||
<TabItem value="go">
|
||||
Returns if field exists in a hash:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
exists, err := vault.HExists ("key", "field1")
|
||||
exists, err := db.HExists ("key", "field1")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Retrieve the value of each of the listed fields from the hash.
|
||||
<TabItem value="go">
|
||||
Retrieve values from a hash:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
values, err := vault.HGet("key", "field1", "field2", "field3")
|
||||
values, err := db.HGet("key", "field1", "field2", "field3")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Get all fields and values of a hash.
|
||||
<TabItem value="go">
|
||||
Get all fields and values of a hash:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
result, err := vault.HGetAll("key")
|
||||
result, err := db.HGetAll("key")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Increment the hash value by the integer increment.
|
||||
<TabItem value="go">
|
||||
Increment the hash value by the integer increment:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
newValue, err := vault.HIncrBy("key", "field", 7)
|
||||
newValue, err := db.HIncrBy("key", "field", 7)
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Increment the hash value by the float increment.
|
||||
<TabItem value="go">
|
||||
Increment the hash value by the float increment:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
newValue, err := vault.HIncrByFloat("key", "field", 7.75)
|
||||
newValue, err := db.HIncrByFloat("key", "field", 7.75)
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Returns all the fields in a hash.
|
||||
<TabItem value="go">
|
||||
Retrieve all fields from a hash:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
keys, err := vault.HKeys("key")
|
||||
keys, err := db.HKeys("key")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Returns the number of fields in the hash.
|
||||
<TabItem value="go">
|
||||
Retrieve the number of fields in the hash:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
length, err := vault.HLen("key")
|
||||
length, err := db.HLen("key")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -35,11 +35,11 @@ Returns one or more random fields from the hash.
|
||||
<TabItem value="go">
|
||||
Returns one or more random fields from the hash:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
fields, err := vault.HRandField("key", echovault.HRandFieldOptions{})
|
||||
fields, err := db.HRandField("key", db.HRandFieldOptions{})
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -32,11 +32,11 @@ If the field does not exist, it is created.
|
||||
<TabItem value="go">
|
||||
Update each field of the hash with the corresponding value:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
noOfUpdatedFields, err := vault.HSet("key", map[string]string{"field1": "value1", "field2": "value2"})
|
||||
noOfUpdatedFields, err := db.HSet("key", map[string]string{"field1": "value1", "field2": "value2"})
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Set hash field value only if the field does not exist.
|
||||
<TabItem value="go">
|
||||
Set hash field value:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
noOfUpdatedFields, err := vault.HSetNX("key", map[string]string{"field1": "value1", "field2": "value2"})
|
||||
noOfUpdatedFields, err := db.HSetNX("key", map[string]string{"field1": "value1", "field2": "value2"})
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -32,11 +32,11 @@ Returns 0 if the value does not exist.
|
||||
<TabItem value="go">
|
||||
Return the string length of the values stored at the specified fields:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
lengths, err := vault.HStrLen("key", "field1", "field2", "field3")
|
||||
lengths, err := db.HStrLen("key", "field1", "field2", "field3")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Returns all the values of the hash at key.
|
||||
<TabItem value="go">
|
||||
Returns all the values of the hash at key:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
values, err := vault.HVals("key")
|
||||
values, err := db.HVals("key")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Returns the list element at the given index.
|
||||
<TabItem value="go">
|
||||
Returns the list element at the given index:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
element, err := vault.LIndex("key", 2)
|
||||
element, err := db.LIndex("key", 2)
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Returns the length of a list.
|
||||
<TabItem value="go">
|
||||
Returns the length of a list:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
length, err := vault.LLen("key")
|
||||
length, err := db.LLen("key")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -32,11 +32,11 @@ LEFT represents the start of a list. RIGHT represents the end of a list.
|
||||
<TabItem value="go">
|
||||
Move an element from the beginning of the source list to the end of the destination list:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
ok, err := vault.LMove("source", "destination", "LEFT", "RIGHT")
|
||||
ok, err := db.LMove("source", "destination", "LEFT", "RIGHT")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Removes and returns the first element of a list.
|
||||
<TabItem value="go">
|
||||
Removes and returns the first element of a list:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
element, err := vault.LPop("key")
|
||||
element, err := db.LPop("key")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Prepends one or more values to the beginning of a list, creates the list if it d
|
||||
<TabItem value="go">
|
||||
Prepends one or more values to the beginning of a list, creates the list if it does not exist:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
length, err := vault.LPush("key", "element1", "element2")
|
||||
length, err := db.LPush("key", "element1", "element2")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Prepends a value to the beginning of a list only if the list exists.
|
||||
<TabItem value="go">
|
||||
Prepends a value to the beginning of a list only if the list exists:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
length, err := vault.LPushX("key", "element1", "element2")
|
||||
length, err := db.LPushX("key", "element1", "element2")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Return a range of elements between the given indices.
|
||||
<TabItem value="go">
|
||||
Return a range of elements between the given indices:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
list, err := vault.LRange("key", 2, 6)
|
||||
list, err := db.LRange("key", 2, 6)
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Remove `<count>` elements from list.
|
||||
<TabItem value="go">
|
||||
Remove 2 instances if "value1" from the list at key:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
ok, err := vault.Lrem("key", 2, "value1")
|
||||
ok, err := db.Lrem("key", 2, "value1")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Sets the value of an element in a list by its index.
|
||||
<TabItem value="go">
|
||||
Sets the value of an element in a list by its index:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
ok, err := vault.LSet("key", 2, "element")
|
||||
ok, err := db.LSet("key", 2, "element")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Trims a list using the specified range.
|
||||
<TabItem value="go">
|
||||
Trims a list using the specified range:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
ok, err := vault.LTrim("key", 2, 6)
|
||||
ok, err := db.LTrim("key", 2, 6)
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Removes and returns the last element of a list.
|
||||
<TabItem value="go">
|
||||
Removes and returns the last element of a list:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
element, err := vault.RPop("key")
|
||||
element, err := db.RPop("key")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Prepends one or more values to the end of a list, creates the list if it does no
|
||||
<TabItem value="go">
|
||||
Prepends one or more values to the end of a list, creates the list if it does not exist:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
length, err := vault.RPush("key", "element1", "element2")
|
||||
length, err := db.RPush("key", "element1", "element2")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Appends a value to the end of a list only if the list exists.
|
||||
<TabItem value="go">
|
||||
Appends a value to the end of a list only if the list exists:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
length, err := vault.RPushX("key", "element1", "element2")
|
||||
length, err := db.RPushX("key", "element1", "element2")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -39,11 +39,11 @@ Subscribe to one or more patterns. This command accepts glob patterns.
|
||||
event type at index 0 (e.g. subscribe, message), pattern at index 1,
|
||||
message/subscription index at index 2.
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
readMessage := vault.PSubscribe("subscribe_tag_1", "pattern_[12]", "pattern_h[ae]llo") // Return lazy readMessage function
|
||||
readMessage := db.PSubscribe("subscribe_tag_1", "pattern_[12]", "pattern_h[ae]llo") // Return lazy readMessage function
|
||||
for i := 0; i < 2; i++ {
|
||||
message := readMessage() // Call the readMessage function for each channel subscription.
|
||||
}
|
||||
|
@@ -30,11 +30,11 @@ Publish a message to the specified channel.
|
||||
<TabItem value="go">
|
||||
Publish a message to the specified channel:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
ok, err := vault.Publish("channel1", "Hello, world!")
|
||||
ok, err := db.Publish("channel1", "Hello, world!")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -32,11 +32,11 @@ Returns an array containing the list of channels that
|
||||
match the given pattern. If no pattern is provided, all active channels are returned. Active channels are
|
||||
channels with 1 or more subscribers.
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
channels, err := vault.PubSubChannels("channel*")
|
||||
channels, err := db.PubSubChannels("channel*")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -30,11 +30,11 @@ Return the number of patterns that are currently subscribed to by clients.
|
||||
<TabItem value="go">
|
||||
Return the number of patterns that are currently subscribed to by clients.
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
numOfPatterns, err := vault.PubSubNumPat()
|
||||
numOfPatterns, err := db.PubSubNumPat()
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -32,7 +32,7 @@ how many clients are currently subscribed to the channel.
|
||||
Return an array of arrays containing the provided channel name and
|
||||
how many clients are currently subscribed to the channel.
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
@@ -33,19 +33,19 @@ it's currently subscribed to.
|
||||
<TabItem value="go">
|
||||
Unsubscribe from all patterns:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
vault.PUnsubscribe()
|
||||
db.PUnsubscribe()
|
||||
```
|
||||
Unsubscribe from specific patterns:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
vault.PUnsubscribe("pattern_[12]", "pattern_h[ae]llo")
|
||||
db.PUnsubscribe("pattern_[12]", "pattern_h[ae]llo")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -39,11 +39,11 @@ Subscribe to one or more channels.
|
||||
event type at index 0 (e.g. subscribe, message), channel name at index 1,
|
||||
message/subscription index at index 2.
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
readMessage := vault.Subscribe("subscribe_tag_1", "channel1", "channel2") // Return lazy readMessage function
|
||||
readMessage := db.Subscribe("subscribe_tag_1", "channel1", "channel2") // Return lazy readMessage function
|
||||
for i := 0; i < 2; i++ {
|
||||
message := readMessage() // Call the readMessage function for each channel subscription.
|
||||
}
|
||||
|
@@ -33,19 +33,19 @@ it's currently subscribed to.
|
||||
<TabItem value="go">
|
||||
Unsubscribe from all channels:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
vault.Unsubscribe()
|
||||
db.Unsubscribe()
|
||||
```
|
||||
Unsubscribe from specific channels:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
vault.Unsubscribe("channel1", "channel2")
|
||||
db.Unsubscribe("channel1", "channel2")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Add one or more members to the set. If the set does not exist, it's created.
|
||||
<TabItem value="go">
|
||||
Add members to the set:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
cardinality, err := vault.SAdd("key", "member1", "member2")
|
||||
cardinality, err := db.SAdd("key", "member1", "member2")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Returns the cardinality of the set.
|
||||
<TabItem value="go">
|
||||
Get the set's cardinality:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
cardinality, err := vault.SCard("key")
|
||||
cardinality, err := db.SCard("key")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Returns the difference between all the sets in the given keys.
|
||||
<TabItem value="go">
|
||||
Get the difference between 2 sets:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
elements, err := vault.SDiff("key1", "key2")
|
||||
elements, err := db.SDiff("key1", "key2")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Works the same as SDIFF but stores the result at 'destination'.
|
||||
<TabItem value="go">
|
||||
Store the difference between 2 sets:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
cardinality, err := vault.SDiffStore("destination", "key1", "key2")
|
||||
cardinality, err := db.SDiffStore("destination", "key1", "key2")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Returns the intersection of multiple sets.
|
||||
<TabItem value="go">
|
||||
Get the difference between 2 sets:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
elements, err := vault.SInter("key1", "key2")
|
||||
elements, err := db.SInter("key1", "key2")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -35,20 +35,20 @@ is terminated.
|
||||
<TabItem value="go">
|
||||
Get the difference between 2 sets:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
cardinality, err := vault.SInterCard([]string{"key1", "key2"}, 0)
|
||||
cardinality, err := db.SInterCard([]string{"key1", "key2"}, 0)
|
||||
```
|
||||
|
||||
Get the intersection only upto an intersection cardinality of 5:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
cardinality, err := vault.SInterCard([]string{"key1", "key2"}, 5)
|
||||
cardinality, err := db.SInterCard([]string{"key1", "key2"}, 5)
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
@@ -31,11 +31,11 @@ Stores the intersection of multiple sets at the destination key.
|
||||
<TabItem value="go">
|
||||
Get the difference between 2 sets:
|
||||
```go
|
||||
vault, err := echovault.NewEchoVault()
|
||||
db, err := sugardb.NewSugarDB()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
cardinality, err := vault.SInterStore("destination", "key1", "key2")
|
||||
cardinality, err := db.SInterStore("destination", "key1", "key2")
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="cli">
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user