Documentation
¶
Index ¶
- Constants
- func AlterDoc(doc *utils.M, operator string, operation utils.M)
- func CleanupCollections()
- func GetIndexes() map[string]index
- func InArray(key string, arrays ...[]string) bool
- type Attachment
- type AvailableTopic
- type BaseInterface
- type BaseModel
- type Channel
- type Device
- type DeviceToken
- type LastSeen
- type MConn
- func (self *MConn) Count(table string, query utils.M) int
- func (self *MConn) Delete(table string, query utils.M) error
- func (self *MConn) FindAndUpdate(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) InitIndexes()
- func (self *MConn) Insert(table string, arguments ...interface{}) (_id string)
- func (self *MConn) InsertMulti(table string, arguments ...interface{}) (error, *mgo.BulkResult)
- 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 PendingItem
- type Processed
- type SavedItem
- type SentItem
- type Topic
Constants ¶
View Source
const ( DELETE_OPERATION = 1 INSERT_OPERATION = 2 UPDATE_OPERATION = 3 SentCollection = "sent_notifications" StatsCollection = "last_seen_at" TopicCollection = "topics" UserLocaleCollection = "user_locales" DeviceCollection = "devices" SavedEmailCollection = "saved_email" SavedPushCollection = "saved_push" SavedWebCollection = "saved_web" AvailableTopicCollection = "topics_available" ProcessedCollection = "processed" )
View Source
const BLANK = ""
Variables ¶
This section is empty.
Functions ¶
func CleanupCollections ¶
func CleanupCollections()
func GetIndexes ¶
func GetIndexes() map[string]index
Types ¶
type Attachment ¶
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 DeviceToken ¶
type DeviceToken struct { Type string `json:"type" bson:"type"` Token string `json:"token" bson:"token"` AppName string `json:"app_name" bson:"app_name"` AppVariant string `bson:"app_variant" json:"app_variant"` AppVersion string `bson:"app_version" json:"app_version"` AppUniversal bool `bson:"app_universal" json:"app_universal"` }
type MConn ¶
var Conn *MConn
func (*MConn) FindAndUpdate ¶
func (*MConn) InitIndexes ¶
func (self *MConn) InitIndexes()
func (*MConn) InsertMulti ¶
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"` 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"` DeviceTokens []DeviceToken `json:"device_tokens" bson:"device_tokens"` Download Attachment `json:"download" bson:"download"` Attachments []Attachment `json:"attachments" bson:"attachments"` }
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"` 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"` }
Click to show internal directories.
Click to hide internal directories.