-
Notifications
You must be signed in to change notification settings - Fork 5
/
doc.go
40 lines (39 loc) · 1.19 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright (c) 2020 SDSLabs
// Use of this source code is governed by an MIT license
// details of which can be found in the LICENSE file.
// Package kiwi implements a minimalistic in-memory key value store.
//
// Each key is thread safe as it is protected by its own mutex, though different
// keys can be accessed by various threads.
//
// To get started, create a store with the NewStore function and add keys to it
// using AddKey. Each key is associated with a value which has a specific type.
// These types are extendible and can be created by implementing the Value interface.
//
// Store can also be initialized with a schema, which is basically a map of keys
// and value types.
//
//
// Get Started
//
// Create a store, add key and play with it. It's that easy!
//
// store := kiwi.NewStore()
//
// if err := store.AddKey("my_string", "str"); err != nil {
// // handle error
// }
//
// if _, err := store.Do("my_string", "UPDATE", "Hello, World!"); err != nil {
// // handle error
// }
//
// v, err := store.Do("my_string", "GET")
// if err != nil {
// // handle error
// }
//
// fmt.Println(v.(string)) // Hello, World!
//
// For documentation visit https://kiwi.sdslabs.co/docs/
package kiwi