💿 In-memory key value store that saves your data to disk using JSON. 10 Commits
2023-07-06 14:31:23 +02:00
.editorconfig Added explanation 2023-07-05 22:02:16 +02:00
.gitignore Added explanation 2023-07-05 22:02:16 +02:00
Collection_test.go Simplified constructor name 2023-07-06 14:27:48 +02:00
Collection.go Simplified constructor name 2023-07-06 14:27:48 +02:00
go.mod Added basic tests 2023-07-05 17:23:50 +02:00
go.sum Added basic tests 2023-07-05 17:23:50 +02:00
LICENSE Added basic information 2023-07-05 00:20:26 +02:00
README.md Improved documentation 2023-07-06 14:31:23 +02:00

ocean

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.

type User struct {
    Name string
}

// Data saved to ~/.ocean/User/
users := ocean.New[User]("User")

// Store key and value in memory and write ~/.ocean/User/1.json
users.Set("1", &User{Name: "User 1"})

In a real project you would usually prefix your user collection with a project or company name, serving as a namespace:

// Data saved to ~/.ocean/google/User/
users := ocean.New("google", "User")

You can add as many hierarchies as you need but I recommend using a simple /namespace/collection/ structure.