notify

package
v0.0.0-...-2f442fc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeLike   = "like"
	TypeFollow = "follow"
	TypeReply  = "reply"
)

Variables

This section is empty.

Functions

func AddLikeNotification

func AddLikeNotification(like *db.MemoLike, updateCache bool) error

func AddNewFollowerNotification

func AddNewFollowerNotification(follow *db.MemoFollow, updateCache bool) error

func AddReplyNotification

func AddReplyNotification(reply *db.MemoPost, updateCache bool) error

func AttachNamesToNotifications

func AttachNamesToNotifications(notifications []*Notification) error

func AttachProfilePicsToNotifications

func AttachProfilePicsToNotifications(notifications []*Notification) error

Types

type LikeNotification

type LikeNotification struct {
	Like         *db.MemoLike
	Post         *db.MemoPost
	Notification *db.Notification
	Name         string
}

func (LikeNotification) GetAddressString

func (n LikeNotification) GetAddressString() string

func (LikeNotification) GetMessage

func (n LikeNotification) GetMessage() string

func (LikeNotification) GetName

func (n LikeNotification) GetName() string

func (LikeNotification) GetNotification

func (n LikeNotification) GetNotification() *Notification

func (LikeNotification) GetPostHashString

func (n LikeNotification) GetPostHashString() string

func (LikeNotification) GetTime

func (n LikeNotification) GetTime() time.Time

type NewFollowerNotification

type NewFollowerNotification struct {
	Follow       *db.MemoFollow
	Notification *db.Notification
	Name         string
}

func (NewFollowerNotification) GetAddressString

func (n NewFollowerNotification) GetAddressString() string

func (NewFollowerNotification) GetMessage

func (n NewFollowerNotification) GetMessage() string

func (NewFollowerNotification) GetName

func (n NewFollowerNotification) GetName() string

func (NewFollowerNotification) GetNotification

func (n NewFollowerNotification) GetNotification() *Notification

func (NewFollowerNotification) GetPostHashString

func (n NewFollowerNotification) GetPostHashString() string

func (NewFollowerNotification) GetTime

func (n NewFollowerNotification) GetTime() time.Time

type Notification

type Notification struct {
	DbId           uint
	DbNotification *db.Notification
	Type           NotificationType
	Name           string
	PkHash         []byte
	AddressString  string
	PostHashString string
	Message        string
	Time           time.Time
	ProfilePic     *db.MemoSetPic
	// Reply
	ParentMessage    string
	ParentHashString string
	// Like
	TipAmount int64
}

func GetNotificationsFeed

func GetNotificationsFeed(pkHash []byte, offset uint) ([]*Notification, error)

func (Notification) GetId

func (n Notification) GetId() uint

func (Notification) GetTimeAgo

func (n Notification) GetTimeAgo() string

func (Notification) IsLike

func (n Notification) IsLike() bool

func (Notification) IsNewFollower

func (n Notification) IsNewFollower() bool

func (Notification) IsReply

func (n Notification) IsReply() bool

type NotificationType

type NotificationType string

type ReplyNotification

type ReplyNotification struct {
	Post         *db.MemoPost
	Parent       *db.MemoPost
	Notification *db.Notification
	Name         string
}

func (ReplyNotification) GetAddressString

func (n ReplyNotification) GetAddressString() string

func (ReplyNotification) GetMessage

func (n ReplyNotification) GetMessage() string

func (ReplyNotification) GetName

func (n ReplyNotification) GetName() string

func (ReplyNotification) GetNotification

func (n ReplyNotification) GetNotification() *Notification

func (ReplyNotification) GetPostHashString

func (n ReplyNotification) GetPostHashString() string

func (ReplyNotification) GetTime

func (n ReplyNotification) GetTime() time.Time

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL