Documentation ¶
Index ¶
- Constants
- Variables
- func SomeoneCommentedYourCommentEmail(p post.Post, comment comments.Comment, usr user.User) (*gomail.Message, error)
- func SomeoneCommentedYourPostEmail(p post.Post, usr user.User) (*gomail.Message, error)
- func UserID(id bson.ObjectId, take, skip int) common.Query
- type Deps
- type Notification
- type Notifications
- type Socket
Constants ¶
View Source
const BuffersLength = 10
How much capacity each of the incoming notifications channels will have.
View Source
const PoolSize = 4
Variables ¶
View Source
var ( Transmit chan Socket Database chan Notification )
Define pool of channels.
View Source
var NotificationNotFound = errors.New("Notification has not been found by given criteria.")
Functions ¶
func SomeoneCommentedYourCommentEmail ¶
func SomeoneCommentedYourCommentEmail(p post.Post, comment comments.Comment, usr user.User) (*gomail.Message, error)
SomeoneCommentedYourCommentEmail notification constructor.
func SomeoneCommentedYourPostEmail ¶
SomeoneCommentedYourPostEmail notification constructor.
Types ¶
type Notification ¶
type Notification struct { Id bson.ObjectId `bson:"_id,omitempty" json:"id,omitempty"` UserId bson.ObjectId `bson:"user_id" json:"user_id"` Type string `bson:"type" json:"type"` RelatedId bson.ObjectId `bson:"related_id" json:"related_id"` Users []bson.ObjectId `bson:"users" json:"users"` Seen bool `bson:"seen" json:"seen"` Created time.Time `bson:"created_at" json:"created_at"` Updated time.Time `bson:"updated_at" json:"updated_at"` }
type Notifications ¶
type Notifications []Notification
func FetchBy ¶
func FetchBy(deps Deps, query common.Query) (list Notifications, err error)
Fetch multiple leads by conditions
func (Notifications) CommentsScope ¶
func (all Notifications) CommentsScope() common.Scope
func (Notifications) Humanize ¶
func (all Notifications) Humanize(deps Deps) (list []map[string]interface{}, err error)
func (Notifications) UsersScope ¶
func (all Notifications) UsersScope() common.Scope
Source Files ¶
Click to show internal directories.
Click to hide internal directories.