Documentation ¶
Index ¶
- type DataObject
- type Database
- func (d *Database) Commit() error
- func (d *Database) Count() int
- func (d *Database) DeleteOne(path string) bool
- func (d *Database) ListPaths() []string
- func (d *Database) MapObjects() map[string]*DataObject
- func (d *Database) ReadOne(path string) (*DataObject, bool)
- func (d *Database) WriteOne(path string, data *DataObject) (*DataObject, bool)
- type Schema
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataObject ¶
type DataObject struct { Length int64 `json:"length"` SHA1 string `json:"sha1"` SHA256 string `json:"sha256"` Modified time.Time `json:"modified"` }
DataObject is a file object in JSON database
type Database ¶
Database object struct
func NewDatabase ¶
NewDatabase creates new Database object
func (*Database) MapObjects ¶
func (d *Database) MapObjects() map[string]*DataObject
MapObjects Returns objects map
func (*Database) ReadOne ¶
func (d *Database) ReadOne(path string) (*DataObject, bool)
ReadOne reads Data entry for specific file
func (*Database) WriteOne ¶
func (d *Database) WriteOne(path string, data *DataObject) (*DataObject, bool)
WriteOne writes Data entry for specific file
Click to show internal directories.
Click to hide internal directories.