Documentation
¶
Index ¶
- Constants
- func AlterDoc(doc *utils.M, operator string, operation utils.M)
- func Convert(doc utils.M, out interface{})
- func InArray(key string, arrays ...[]string) bool
- type AvailableTopic
- type BaseInterface
- type BaseModel
- type Channel
- type Defaults
- type Gully
- type LastSeen
- type Locks
- type MConn
- func (self *MConn) Aggregate(session *mgo.Session, table string, doc []utils.M) *mgo.Pipe
- func (self *MConn) Count(table string, query utils.M) int
- func (self *MConn) Delete(table string, query utils.M) error
- func (self *MConn) DropIndex(table string, key ...string) error
- func (self *MConn) DropIndices(table string) error
- func (self *MConn) EnsureIndex(table string, index mgo.Index) error
- func (self *MConn) FindAndUpdate(table string, query utils.M, doc utils.M, result interface{}) (*mgo.ChangeInfo, error)
- func (self *MConn) FindAndUpsert(table string, query utils.M, doc utils.M, result interface{}) (*mgo.ChangeInfo, error)
- func (self *MConn) Get(session *mgo.Session, table string, query utils.M) *mgo.Iter
- func (self *MConn) GetCursor(session *mgo.Session, table string, query utils.M) *mgo.Query
- func (self *MConn) GetOne(table string, query utils.M, result interface{}) error
- func (self *MConn) HintedCount(table string, query utils.M, hint string) int
- func (self *MConn) HintedGetOne(table string, query utils.M, result interface{}, hint string) error
- func (self *MConn) Insert(table string, arguments ...interface{}) (_id string)
- func (self *MConn) InsertMulti(table string, arguments ...interface{}) (error, *mgo.BulkResult)
- func (self *MConn) MapReduce(session *mgo.Session, table string, query utils.M, result interface{}, ...) (*mgo.MapReduceInfo, error)
- func (self *MConn) Update(table string, query utils.M, doc utils.M) error
- func (self *MConn) Upsert(table string, query utils.M, doc utils.M) error
- type MapReduce
- type PendingItem
- type Processed
- type SavedItem
- type SentItem
- type Topic
- type UserLocale
Constants ¶
View Source
const ( DELETE_OPERATION = 1 INSERT_OPERATION = 2 UPDATE_OPERATION = 3 SentCollection = "sent_notifications" StatsCollection = "last_seen_at" TopicCollection = "topics" GullyCollection = "gullys" UserLocaleCollection = "user_locales" SavedEmailCollection = "saved_email" SavedPushCollection = "saved_push" SavedWebCollection = "saved_web" AvailableTopicCollection = "topics_available" DefaultsCollection = "defaults" LocksCollection = "locks" ProcessedCollection = "processed" )
View Source
const BLANK = ""
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AvailableTopic ¶
type AvailableTopic struct {
BaseModel `bson:",inline"`
Ident string `json:"ident" bson:"ident" required:"true" form:"ident" binding:"required"`
AppName string `json:"app_name" bson:"app_name" required:"true" form:"app_name" binding:"required"`
Channels []string `json:"channels" bson:"channels" required:"true" form:"channels" binding:"required"`
}
type BaseInterface ¶
type BaseInterface interface {
PrepareSave()
}
type BaseModel ¶
type BaseModel struct {
Id bson.ObjectId `json:"_id,omitempty" bson:"_id" required:"true"`
CreatedOn int64 `json:"created_on" bson:"created_on" required:"true"`
ModifiedOn int64 `json:"updated_on" bson:"updated_on" required:"true"`
}
func (*BaseModel) PrepareSave ¶
func (self *BaseModel) PrepareSave()
type Gully ¶
type Gully struct {
BaseModel `bson:",inline"`
User string `json:"user" bson:"user"`
Organization string `json:"org" bson:"org"`
AppName string `json:"app_name" bson:"app_name"`
Data map[string]interface{} `json:"data" bson:"data" required:"true"`
Ident string `json:"ident" bson:"ident" required:"true"`
}
type MConn ¶
var Conn *MConn
func (*MConn) DropIndices ¶
func (*MConn) FindAndUpdate ¶
func (*MConn) FindAndUpsert ¶
func (*MConn) HintedCount ¶
func (*MConn) HintedGetOne ¶
func (*MConn) InsertMulti ¶
func (self *MConn) InsertMulti(table string, arguments ...interface{}) (error, *mgo.BulkResult)
type PendingItem ¶
type PendingItem struct {
BaseModel `bson:",inline"`
CreatedBy string `json:"created_by" bson:"created_by" required:"true"`
Organization string `json:"org" bson:"org" required:"true"`
AppName string `json:"app_name" bson:"app_name" required:"true"`
Topic string `json:"topic" bson:"topic" required:"true"`
IsPending bool `json:"is_pending" bson:"is_pending" required:"true"`
User string `json:"user" bson:"user" required:"true"`
DestinationUri string `json:"destination_uri" bson:"destination_uri" required:"true"`
Context map[string]interface{} `json:"context" bson:"context" required:"true"`
IsRead bool `json:"is_read" bson:"is_read"`
Entity string `json:"entity" bson:"entity" required:"true"`
}
func (*PendingItem) IsValid ¶
func (self *PendingItem) IsValid() bool
type SavedItem ¶
type SavedItem struct {
BaseModel `bson:",inline"`
Data interface{} `bson:"data"`
Details PendingItem `bson:"details"`
}
type SentItem ¶
type SentItem struct {
BaseModel `bson:",inline"`
CreatedBy string `json:"created_by" bson:"created_by" required:"true"`
Organization string `json:"org" bson:"org" required:"true"`
AppName string `json:"app_name" bson:"app_name" required:"true"`
Topic string `json:"topic" bson:"topic" required:"true"`
User string `json:"user" bson:"user" required:"true"`
DestinationUri string `json:"destination_uri" bson:"destination_uri" required:"true"`
Text string `json:"text" bson:"text" required:"true"`
IsRead bool `json:"is_read" bson:"is_read"`
Context map[string]interface{} `json:"context" bson:"context"`
Entity string `json:"entity" bson:"entity" required:"true"`
}
type UserLocale ¶
type UserLocale struct {
BaseModel `bson:",inline"`
User string `json:"user" bson:"user" required:"true"`
Locale string `json:"locale" bson:"locale" required:"true"`
TimeZone string `json:"timezone" bson:"timezone" required:"true"`
}
func (*UserLocale) IsValid ¶
func (self *UserLocale) IsValid() bool
Click to show internal directories.
Click to hide internal directories.