Skip to content

Commit

Permalink
feat(readme): add information about cli,tcp
Browse files Browse the repository at this point in the history
  • Loading branch information
baibikov committed Sep 13, 2022
1 parent 3cad5b2 commit 93a9bb4
Showing 1 changed file with 29 additions and 33 deletions.
62 changes: 29 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,39 +54,35 @@ take the next 4 bytes - the offset of the comic messages

### Quick Start:

#### Run tcp server on current port
```bash
go get github.com/baibikov/jellydb
go run cmd/tcp/main.go -addr :7777
```
Code:

```go
package main

import (
"fmt"
"log"

"github.com/baibikov/jellydb/jellystore"
)

func main() {
store, err := jellystore.New(&jellystore.Config{
Path: "YOU_STORE_PATH",
})
if err != nil {
log.Fatal(err)
}

err = store.Set("key", []byte("some_message"))
if err != nil {
log.Fatal(err)
}

bb, err := store.Get("key", 1)
if err != nil {
log.Fatal(err)
}

fmt.Println(bb)
}

#### Run CLI
```bash
go run cmd/cli/main.go -addr :7777
```

#### Commands for use
```
(sys)
-help: Navigating existing Commands
exit: Exit from CLI
clear: Carriage cleaning
(store)
SET: Adding an entry to the read queue, as soon as the entry
example:
> SET my_super_important SOME_VALUE_1
GET [N]: Getting uncommitted messages from the batch queue and n is batch elements
example:
> GET my_super_important 2
> SOME_VALUE_1
> SOME_VALUE_2
COM [N]: Commenting on a batch of messages
example:
> COMMIT my_super_important 2
```

0 comments on commit 93a9bb4

Please sign in to comment.