-
Notifications
You must be signed in to change notification settings - Fork 0
/
doc.go
32 lines (23 loc) · 958 Bytes
/
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
// Copyright 2023 The imagine Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// imagine is a diskmap implementation
// for some case, we has map which got a large number of members, and then lack of RAM happens……
// for the purpose of saving shortage RAM resource, we designed this diskmap project. Just like its name, we use cheap disk storage for the most records in a map, and high-performance, expensive ram for cache.
package imagine
// you can use it as :
// ctx := context.Background()
// dmaps, err := NewDmaps(DmapsOption{Dir: "testdata"})
// if err != nil {
// log.Println(err)
// return
// }
// defer dmaps.Close(ctx)
// m := dmaps.MustGetMap(ctx, "users")
// m.Set(ctx, "longalong", []byte("i am longalong, nice to meet you ~"))
// v, err := m.Get(ctx, "longalong")
// if err != nil {
// log.Println(err)
// return
// }
// log.Println(v)