package
module
Version:
v0.0.0-...-4336eae
Opens a new window with list of versions in this module.
Published: Sep 20, 2016
License: MIT
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 4
Opens a new window with list of known importers.
README
¶
kvstore
kvstore - simple in-memory key-value store with persistense.
Features
License
The MIT License (MIT), see LICENSE.
Copyright (c) 2016 Alexey Kovrizhkin ak@elfire.ru
Documentation
¶
Package kvstore is a simple key-value in memory store
with persistense in json file
Config sets store config from flag var
DataMap holds stored items
type Flags struct {
StoreName string `long:"store_file" default:"store.json" description:"File to store sent codes at program exit"`
}
Flags is a package flags sample
in form ready for use with github.com/jessevdk/go-flags
Store holda all store attributes
Del deletes a key and returns true if it was founded
func (s *Store) Destroy()
Destroy saves store data into file
Get returns data by key and true if it was founded
Keys returns list of store keys
Load reads json file and places it in store
Save saves store into json file
Set saves data in store and returns true if key was rewritten
StoreData interface holds sore item methods
Source Files
¶
Click to show internal directories.
Click to hide internal directories.