Documentation ¶
Overview ¶
Package scribble is a tiny gob database
Index ¶
- Constants
- type Collection
- func (c *Collection) Check() (bool, error)
- func (c *Collection) Delete() error
- func (c *Collection) Document(key string) *Document
- func (c *Collection) GetAllDocuments() ([]*Document, error)
- func (c *Collection) GetDocuments(start, end int) ([]*Document, error)
- func (c *Collection) PreGen() (bool, error)
- type Document
Constants ¶
const Version = "4.4.0"
Version is the current version of the project
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
Collection a collection of documents
func (*Collection) Check ¶
func (c *Collection) Check() (bool, error)
Check if there is an error while getting the collection
func (*Collection) Delete ¶
func (c *Collection) Delete() error
Delete removes a collection and all of its childeren
func (*Collection) Document ¶
func (c *Collection) Document(key string) *Document
Document gets a document from a collection
func (*Collection) GetAllDocuments ¶
func (c *Collection) GetAllDocuments() ([]*Document, error)
GetAllDocuments gets all documents in a collection.
func (*Collection) GetDocuments ¶
func (c *Collection) GetDocuments(start, end int) ([]*Document, error)
GetDocuments gets documents in a collection starting from start til end, if start
func (*Collection) PreGen ¶
func (c *Collection) PreGen() (bool, error)
PreGen does a check to see if there is an error while getting the collection and make them if they dont exist yet.
type Document ¶
type Document struct {
// contains filtered or unexported fields
}
Document a single document which can have sub collections
func New ¶
New creates a new scribble database at the desired directory location, and returns a *Driver to then use for interacting with the database
func (*Document) Collection ¶
func (d *Document) Collection(name string) *Collection
Collection gets a collction from in a document
func (*Document) Delete ¶
Delete locks that database and removes the document including all of its sub documents
func (*Document) PreGen ¶
PreGen does a check to see if there is an error while getting the documents and make them if they dont exist yet.