Documentation
ΒΆ
Index ΒΆ
- func Save(ks *JSONStore, filename string) error
- func SaveAndRename(ks *JSONStore, filename string) error
- type JSONStore
- func (s *JSONStore) Delete(key string)
- func (s *JSONStore) Get(key string, v interface{}) error
- func (s *JSONStore) GetAll(matcher func(key string) bool) *JSONStore
- func (s *JSONStore) Keys() []string
- func (s *JSONStore) Set(key string, value interface{}) error
- func (s *JSONStore) Size() int
- func (s *JSONStore) StartAutoSave(filename string, d time.Duration, count int64)
- func (s *JSONStore) StopAutoSave()
- type NoSuchKeyError
Constants ΒΆ
This section is empty.
Variables ΒΆ
This section is empty.
Functions ΒΆ
func SaveAndRename ΒΆ
SaveAndRename writes the jsonstore to disk more safely. First, SaveAndRename writes the jsonstore to temporary file, and then rename it to filename. NOTE: os.Rename renames atomic on POSIX systems, but no guarantee on other systems.
Types ΒΆ
type JSONStore ΒΆ
JSONStore is the basic store object.
func (*JSONStore) StartAutoSave ΒΆ
StartAutoSave starts auto saving.
func (*JSONStore) StopAutoSave ΒΆ
func (s *JSONStore) StopAutoSave()
StopAutoSave stops auto saving.
type NoSuchKeyError ΒΆ
type NoSuchKeyError struct {
// contains filtered or unexported fields
}
NoSuchKeyError is thrown when calling Get with invalid key
func (NoSuchKeyError) Error ΒΆ
func (err NoSuchKeyError) Error() string
Click to show internal directories.
Click to hide internal directories.