mirror of
https://github.com/gogrlx/bitcask.git
synced 2026-04-02 02:58:59 -07:00
Makefile setup & key/value coherent datatypes & refactoring (#98)
* internal/data: comment exported functions * internal/data: make smaller codec exported api surface * make key and value sizes serializing bubble up to everything * Makefile setup & go mod tidy
This commit is contained in:
@@ -7,10 +7,10 @@ const (
|
||||
DefaultMaxDatafileSize = 1 << 20 // 1MB
|
||||
|
||||
// DefaultMaxKeySize is the default maximum key size in bytes
|
||||
DefaultMaxKeySize = 64 // 64 bytes
|
||||
DefaultMaxKeySize = uint32(64) // 64 bytes
|
||||
|
||||
// DefaultMaxValueSize is the default value size in bytes
|
||||
DefaultMaxValueSize = 1 << 16 // 65KB
|
||||
DefaultMaxValueSize = uint64(1 << 16) // 65KB
|
||||
|
||||
// DefaultSync is the default file synchronization action
|
||||
DefaultSync = false
|
||||
@@ -28,7 +28,7 @@ func WithMaxDatafileSize(size int) Option {
|
||||
}
|
||||
|
||||
// WithMaxKeySize sets the maximum key size option
|
||||
func WithMaxKeySize(size int) Option {
|
||||
func WithMaxKeySize(size uint32) Option {
|
||||
return func(cfg *config.Config) error {
|
||||
cfg.MaxKeySize = size
|
||||
return nil
|
||||
@@ -36,7 +36,7 @@ func WithMaxKeySize(size int) Option {
|
||||
}
|
||||
|
||||
// WithMaxValueSize sets the maximum value size option
|
||||
func WithMaxValueSize(size int) Option {
|
||||
func WithMaxValueSize(size uint64) Option {
|
||||
return func(cfg *config.Config) error {
|
||||
cfg.MaxValueSize = size
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user