mirror of
https://github.com/taigrr/bitcask
synced 2025-01-18 04:03:17 -08: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:
@@ -50,11 +50,11 @@ func init() {
|
||||
"with-max-datafile-size", "", bitcask.DefaultMaxDatafileSize,
|
||||
"Maximum size of each datafile",
|
||||
)
|
||||
exportCmd.PersistentFlags().IntP(
|
||||
exportCmd.PersistentFlags().Uint32P(
|
||||
"with-max-key-size", "", bitcask.DefaultMaxKeySize,
|
||||
"Maximum size of each key",
|
||||
)
|
||||
exportCmd.PersistentFlags().IntP(
|
||||
exportCmd.PersistentFlags().Uint64P(
|
||||
"with-max-value-size", "", bitcask.DefaultMaxValueSize,
|
||||
"Maximum size of each value",
|
||||
)
|
||||
|
||||
@@ -30,8 +30,8 @@ var initdbCmd = &cobra.Command{
|
||||
path := viper.GetString("path")
|
||||
|
||||
maxDatafileSize := viper.GetInt("with-max-datafile-size")
|
||||
maxKeySize := viper.GetInt("with-max-key-size")
|
||||
maxValueSize := viper.GetInt("with-max-value-size")
|
||||
maxKeySize := viper.GetUint32("with-max-key-size")
|
||||
maxValueSize := viper.GetUint64("with-max-value-size")
|
||||
|
||||
db, err := bitcask.Open(
|
||||
path,
|
||||
@@ -56,11 +56,11 @@ func init() {
|
||||
"with-max-datafile-size", "", bitcask.DefaultMaxDatafileSize,
|
||||
"Maximum size of each datafile",
|
||||
)
|
||||
initdbCmd.PersistentFlags().IntP(
|
||||
initdbCmd.PersistentFlags().Uint32P(
|
||||
"with-max-key-size", "", bitcask.DefaultMaxKeySize,
|
||||
"Maximum size of each key",
|
||||
)
|
||||
initdbCmd.PersistentFlags().IntP(
|
||||
initdbCmd.PersistentFlags().Uint64P(
|
||||
"with-max-value-size", "", bitcask.DefaultMaxValueSize,
|
||||
"Maximum size of each value",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user