-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathoptions.go
More file actions
25 lines (21 loc) · 698 Bytes
/
Copy pathoptions.go
File metadata and controls
25 lines (21 loc) · 698 Bytes
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
package tiny_bitcask
import "tiny-bitcask/storage"
const (
DefaultSegmentSize = 256 * storage.MB
)
var (
DefaultOptions = &Options{
Dir: "db",
SegmentSize: DefaultSegmentSize,
VerifyCRC: true,
ExclusiveLock: true,
}
)
// Options configures the database. Zero value is not valid; use DefaultOptions or set fields explicitly.
type Options struct {
Dir string
SegmentSize int64
VerifyCRC bool // verify CRC32 on every read (default true when using DefaultOptions)
ReadOnly bool // open existing store read-only (ListKeys, Get, Fold allowed)
ExclusiveLock bool // advisory flock on .tiny-bitcask.lock (Unix); shared lock when ReadOnly
}