move DefaultRepository into own file; add todo tags;

This commit is contained in:
2024-12-28 01:34:09 +01:00
parent 564b6f815e
commit 293384862c
6 changed files with 82 additions and 79 deletions

View File

@@ -7,13 +7,13 @@ import (
"encoding/json"
)
// A very simple datastructure, implementing the IDatastore interface. It uses
// a simple text file to the data as json.
type FileDatastore struct {
path string
}
// Creates a new FileDatastore object, creating the storage file in the
// process.
func NewFileDatastore(path string) (*FileDatastore, error) {
@@ -120,7 +120,6 @@ func (fds *FileDatastore) GetAllKeys() (map[string]bool, error) {
// Deletes the entry with the given key. May through an error if the file
// cannot be opened or the contents cannot be decoded or encoded correctly.
func (fds *FileDatastore) Delete(key string) error {
m, err := fds.readMapObj()
if err != nil { return err }