notification

package
v0.0.0-...-9b4e82f Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const EndEffectNotificationType = "end_effect"
View Source
const NewEffectNotificationType = "new_effect"
View Source
const NewItemNotificationType = "new_item"
View Source
const ReceiveNotificationType = "receive_money"
View Source
const SendMoneyNotificationType = "send_money"
View Source
const TradeNotificationType = "trade"
View Source
const UsedItemNotificationType = "used_item"

Variables

View Source
var NotificationLock = lock.NewLock("notifications")

Functions

func AcknowledgeNotification

func AcknowledgeNotification(uuid, portfolioUuid string) error

func DeleteNotification

func DeleteNotification(note *Notification)

func DeleteRequest

func DeleteRequest(uuid string) error

func JsonToNotification

func JsonToNotification(jsonString, notificationType string) interface{}

func SendMoneyTradeNotification

func SendMoneyTradeNotification(portfolioUuid, receiverUuid string, amount int64) (*Notification, *Notification)

Types

type EffectNotification

type EffectNotification struct {
	EffectTitle string `json:"title"`
}

type ItemNotification

type ItemNotification struct {
	ItemType string `json:"item_type"`
	ItemUuid string `json:"item_uuid"`
}

type MailNotification

type MailNotification struct {
	From  string `json:"from"`
	Text  string `json:"text"`
	Money int64  `json:"money"`
}

type MoneyTransferNotification

type MoneyTransferNotification struct {
	Sender   string `json:"sender"`
	Receiver string `json:"receiver"`
	Amount   int64  `json:"amount"`
}

type Notification

type Notification struct {
	objects.Notification
}

func DoneTradeNotification

func DoneTradeNotification(portfilioUuid, stockUuid string, amount int64) *Notification

func EndEffectNotification

func EndEffectNotification(portfolioId, effectTitle string) *Notification

func GetAllNotifications

func GetAllNotifications(portfolioUuid string) []*Notification

func MakeNotification

func MakeNotification(notification objects.Notification) *Notification

func NewEffectNotification

func NewEffectNotification(portfolioId, effectTitle string) *Notification

func NewItemNotification

func NewItemNotification(portfolioUuid, itemType, itemUuid string) *Notification

func NewMailNotifcation

func NewMailNotifcation(uuid, from string, text string, money int64) *Notification

func NewNotification

func NewNotification(portfolioUuid, t string, notification interface{}) *Notification

func UsedItemNotification

func UsedItemNotification(portfolioUuid, itemUuid, itemType string) *Notification

type TradeNotification

type TradeNotification struct {
	Success   bool   `json:"success"`
	Amount    int64  `json:"amount"`
	StockUuid string `json:"stock"`
	Err       string `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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