Improved documentation
This commit is contained in:
parent
f769092c16
commit
af35cde2d8
@ -4,13 +4,15 @@ In-memory key value store that saves your data to plain old JSON files.
|
|||||||
|
|
||||||
If you like, you can operate on your entire data with classic UNIX tools.
|
If you like, you can operate on your entire data with classic UNIX tools.
|
||||||
|
|
||||||
|
Suitable for small to medium data volume.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
go get git.akyoto.dev/go/ocean
|
go get git.akyoto.dev/go/ocean
|
||||||
```
|
```
|
||||||
|
|
||||||
## Examples
|
## Example
|
||||||
|
|
||||||
```go
|
```go
|
||||||
// User data
|
// User data
|
||||||
@ -23,6 +25,9 @@ users := ocean.New[User]("User")
|
|||||||
|
|
||||||
// Store key and value in memory and write ~/.ocean/User/1.json
|
// Store key and value in memory and write ~/.ocean/User/1.json
|
||||||
users.Set("1", &User{Name: "User 1"})
|
users.Set("1", &User{Name: "User 1"})
|
||||||
|
|
||||||
|
// Read value from memory
|
||||||
|
user, err := users.Get("1")
|
||||||
```
|
```
|
||||||
|
|
||||||
In a real project you would usually prefix your collections with a project or company name:
|
In a real project you would usually prefix your collections with a project or company name:
|
||||||
|
Loading…
Reference in New Issue
Block a user