{"modulePath":"github.com/infinitbyte/framework","version":"v1.1.5","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package badger\n\n## Constants\n\n```go\nconst (\n\tSortBySize  = \"size\"  // Constant to specify sorting by size\n\tSortByCount = \"count\" // Constant to specify sorting by count\n)\n```\n\n## Types\n\n```go\ntype ByCount []*KeyStats\n```\nByCount implements sort.Interface to sort KeyStats by the occurrence count of each key.\n\n```go\nfunc (a ByCount) Len() int\n```\n\n```go\nfunc (a ByCount) Less(i, j int) bool\n```\n\n```go\nfunc (a ByCount) Swap(i, j int)\n```\n\n```go\ntype BySize []*KeyStats\n```\nBySize implements sort.Interface to sort KeyStats by the size of the value for each key.\n\n```go\nfunc (a BySize) Len() int\n```\n\n```go\nfunc (a BySize) Less(i, j int) bool\n```\n\n```go\nfunc (a BySize) Swap(i, j int)\n```\n\n```go\ntype Config struct {\n\tEnabled bool `config:\"enabled\"`\n\n\tSingleBucketMode   bool   `config:\"single_bucket_mode\"`\n\tPath               string `config:\"path\"`\n\tInMemoryMode       bool   `config:\"memory_mode\"`\n\tSyncWrites         bool   `config:\"sync_writes\"`\n\tMemTableSize       int64  `config:\"mem_table_size\"`\n\tValueLogFileSize   int64  `config:\"value_log_file_size\"`\n\tValueThreshold     int64  `config:\"value_threshold\"`\n\tValueLogMaxEntries uint32 `config:\"value_log_max_entries\"`\n\tNumMemtables       int    `config:\"num_mem_tables\"`\n\n\tNumLevelZeroTables      int `config:\"num_level0_tables\"`\n\tNumLevelZeroTablesStall int `config:\"num_level0_tables_stall\"`\n\n\tValueLogGCEnabled           bool    `config:\"value_log_gc_enabled\"`\n\tValueLogDiscardRatio        float64 `config:\"value_log_gc_discard_ratio\"`\n\tValueLogGCIntervalInSeconds int     `config:\"value_log_gc_interval_in_seconds\"`\n}\n```\n\n```go\ntype KeyStats struct {\n\tKey   string // The key itself\n\tCount int    // The number of times the key appears in the database\n\tSize  int64  // The size of the key's associated value\n}\n```\nKeyStats represents the statistics for each key, including its occurrence count and value size.\n\n```go\ntype Module struct {\n\tapi.Handler\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (filter *Module) Add(bucket string, key []byte) error\n```\n\n```go\nfunc (filter *Module) AddValue(bucket string, key []byte, value []byte) error\n```\n\n```go\nfunc (filter *Module) AddValueCompress(bucket string, key []byte, value []byte) error\n```\n\n```go\nfunc (filter *Module) CheckThenAdd(bucket string, key []byte) (b bool, err error)\n```\n\n```go\nfunc (filter *Module) Close() error\n```\n\n```go\nfunc (filter *Module) Delete(bucket string, key []byte) error\n```\n\n```go\nfunc (filter *Module) DeleteKey(bucket string, key []byte) error\n```\n\n```go\nfunc (filter *Module) Exists(bucket string, key []byte) bool\n```\n\n```go\nfunc (filter *Module) ExistsKey(bucket string, key []byte) (bool, error)\n```\n\n```go\nfunc (filter *Module) GetCompressedValue(bucket string, key []byte) ([]byte, error)\n```\n\n```go\nfunc (filter *Module) GetValue(bucket string, key []byte) ([]byte, error)\n```\nfor kv implementation\n\n```go\nfunc (module *Module) Name() string\n```\n\n```go\nfunc (filter *Module) Open() error\n```\n\n```go\nfunc (module *Module) Setup()\n```\n\n```go\nfunc (module *Module) Start() error\n```\n\n```go\nfunc (module *Module) Stop() error\n```\n\n","path":"github.com/infinitbyte/framework/plugins/badger","name":"badger","synopsis":"","isRedistributable":true}
