Documentation ¶
Index ¶
- Variables
- func AssertGuid(maybeGuid string) (val string, exists bool)
- func ClearCache()
- func DB() (*mgo.Database, *mgo.Session)
- func Files() *mgo.GridFS
- func FlushCache() error
- func FromCache(key string) (string, bool)
- func LoadCache() error
- func Objects() *mgo.Collection
- func SetCache(key string, data string)
- type Attachment
- type AttributeQuery
- type KeyVal
- type Object
- func (o *Object) AddAttribute(name string, value string)
- func (o *Object) AddTag(value string)
- func (o *Object) AttachmentIndex(objectId string) int
- func (o *Object) AttributeIndex(name string, value string) int
- func (o *Object) GetAttachment(objectId string) Attachment
- func (o Object) HasAttribute(name string, value string) bool
- func (o Object) HasTag(tag string) bool
- func (o *Object) RemoveAttachment(objectId string)
- func (o *Object) RemoveAttribute(name string, value string)
- func (o Object) RemoveTag(tag string)
- func (o *Object) Update() error
- type Query
- type SearchObject
Constants ¶
This section is empty.
Variables ¶
View Source
var AttributeQueryReg = regexp.MustCompile("([^:]+):?(.*)")
Functions ¶
func AssertGuid ¶
func ClearCache ¶
func ClearCache()
func FlushCache ¶
func FlushCache() error
Types ¶
type Attachment ¶
type Attachment struct { Id bson.ObjectId `bson:"_id" json:"id"` UploadDate time.Time `bson:"uploadDate" json:"uploadDate"` Filename string `bson:"filename" json:"filename"` MetaData []KeyVal `bson:"metadata" json:"metadata"` Content string `bson:"content" json:"content"` }
func CreateAttachment ¶
func CreateAttachment(file *mgo.GridFile, filename string, content string, metadata map[string]string) *Attachment
func GetAttachment ¶
func GetAttachment(id string) (Attachment, error)
type AttributeQuery ¶
type Object ¶
type Object struct { Id bson.ObjectId `bson:"_id,omitempty" json:"id"` Title string `bson:"title" json:"title"` CreateDate time.Time `bson:"createDate" json:"createDate"` Attributes []KeyVal `bson:"attributes" json:"attributes"` Attachments []Attachment `bson:"attachments" json:"attachments"` }
func CreateObject ¶
func (*Object) AddAttribute ¶
func (*Object) AttachmentIndex ¶
func (*Object) GetAttachment ¶
func (o *Object) GetAttachment(objectId string) Attachment
func (*Object) RemoveAttachment ¶
func (*Object) RemoveAttribute ¶
Click to show internal directories.
Click to hide internal directories.