{"modulePath":"github.com/infinitbyte/framework","version":"v1.1.5","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package simple_kv\n\n## Types\n\n```go\ntype Config struct {\n\tEnabled    bool   `config:\"enabled\"`\n\tPath       string `config:\"path\"`\n\tSyncWrites bool   `config:\"sync_writes\"`\n}\n```\n\n```go\ntype KVStore struct {\n\t// contains filtered or unexported fields\n}\n```\nKVStore represents a simple key-value store.\n\n```go\nfunc NewKVStore(lastStateFilename, walFilename string) *KVStore\n```\nNewKVStore creates a new key-value store and initializes the current state from the last state file.\n\n```go\nfunc (kv *KVStore) Delete(key string) error\n```\nDelete removes a key-value pair from the store and writes to the WAL synchronously.\n\n```go\nfunc (kv *KVStore) Get(key string) ([]byte, error)\n```\n\n```go\nfunc (kv *KVStore) Set(key string, value []byte) error\n```\n\n```go\ntype LastState struct {\n\tData map[string][]byte `json:\"data\"`\n}\n```\nLastState represents the last state of the key-value store.\n\n```go\ntype SimpleKV struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (filter *SimpleKV) Add(bucket string, key []byte) error\n```\n\n```go\nfunc (filter *SimpleKV) AddValue(bucket string, key []byte, value []byte) error\n```\n\n```go\nfunc (filter *SimpleKV) AddValueCompress(bucket string, key []byte, value []byte) error\n```\n\n```go\nfunc (filter *SimpleKV) CheckThenAdd(bucket string, key []byte) (b bool, err error)\n```\n\n```go\nfunc (filter *SimpleKV) Close() error\n```\n\n```go\nfunc (filter *SimpleKV) Delete(bucket string, key []byte) error\n```\n\n```go\nfunc (filter *SimpleKV) DeleteKey(bucket string, key []byte) error\n```\n\n```go\nfunc (filter *SimpleKV) Exists(bucket string, key []byte) bool\n```\n\n```go\nfunc (filter *SimpleKV) ExistsKey(bucket string, key []byte) (bool, error)\n```\n\n```go\nfunc (filter *SimpleKV) GetCompressedValue(bucket string, key []byte) ([]byte, error)\n```\n\n```go\nfunc (filter *SimpleKV) GetValue(bucket string, key []byte) ([]byte, error)\n```\n\n```go\nfunc (module *SimpleKV) Name() string\n```\n\n```go\nfunc (filter *SimpleKV) Open() error\n```\n\n```go\nfunc (module *SimpleKV) Setup()\n```\n\n```go\nfunc (module *SimpleKV) Start() error\n```\n\n```go\nfunc (module *SimpleKV) Stop() error\n```\n\n```go\ntype WAL struct {\n\t// contains filtered or unexported fields\n}\n```\nWAL represents a Write-Ahead Log for storing key-value changes.\n\n```go\nfunc (wal *WAL) Close()\n```\n\n```go\nfunc (wal *WAL) Open() error\n```\n\n","path":"github.com/infinitbyte/framework/plugins/simple_kv","name":"simple_kv","synopsis":"","isRedistributable":true}
