Documentation ¶
Overview ¶
Package db handles database interaction for thymeline
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetOpDirs ¶
GetOpDirs queries the OpDir collection for a list of all operation directories
Returns A slice of strings containing paths to operation screenshot directories
func GetOpNameFromPath ¶
GetOpNameFromPath gets the Name property of an OpDir and returns if it exists
func RemoveOpDir ¶
RemoveOpDir removes a document from the Database_DB OpDir collection
func SaveScreenshot ¶
SaveScreenshot stores a screenshot to the local Event Cache
Types ¶
type OpDir ¶
type OpDir struct { ID bson.ObjectId `json:"id" bson:"_id,omitempty"` // Operation map[string]string `json:"operation" bson:"operation"` Operation Op }
OpDir hold a map that links directory paths to operation names
type ScreenshotEvent ¶
type ScreenshotEvent struct { ID bson.ObjectId `json:"id" bson:"_id,omitempty"` Timestamp time.Time `json:"timestamp"` OpName string `json:"op_name"` Description string `json:"description"` Filename string `json:"filename"` LocalPath string `json:"local_path"` Hash string `json:"hash"` }
Screenshot contains a single screenshot event
type Session ¶
Session wraps an pointer to an mgo.Session and adds convenience methods
func Connect ¶
Connect connects to a MongoDB server and initiates a session
Returns *Session - pointer to a Session error if any
func (*Session) GetCollection ¶
func (s *Session) GetCollection(db string, collection string) *mgo.Collection
GetCollection gets a collection from a database given a valid session and returns a pointer to the collection