Documentation ¶
Index ¶
- Variables
- func CreateTopic(id string) error
- func DeleteTopic(id string) error
- func GenerateNotificationJson(notification models.Notification) (string, error)
- func GetAllNotifications(topics []string) ([]models.Notification, error)
- func GetAllNotificationsForTopic(topic string) ([]models.Notification, error)
- func GetAllPublicNotifications() ([]models.Notification, error)
- func GetAllTopicIDs() ([]string, error)
- func GetNotificationOrder(id string) (*models.NotificationOrder, error)
- func GetNotificationRecipientArns(userIds []string) ([]string, error)
- func GetNotificationRecipients(topicId string) ([]string, error)
- func GetSubscriptions(id string) ([]string, error)
- func GetTopic(id string) (*models.Topic, error)
- func GetUserDevices(id string) ([]string, error)
- func GetUserRoles(id string) ([]string, error)
- func GetUsersByRole(role string) ([]string, error)
- func GetValidRoles() (*models.UserRoleList, error)
- func Initialize() error
- func PublishNotification(id string, payload string, arns []string) error
- func PublishNotificationToTopic(notification models.Notification) (*models.NotificationOrder, error)
- func PublishNotificationWorker(notification string, device_arns <-chan string, responses chan<- bool)
- func RegisterDeviceToUser(token string, platform string, id string) error
- func SetUserDevices(id string, devices []string) error
- func SubscribeToTopic(userId string, topicId string) error
- func UnsubscribeToTopic(userId string, topicId string) error
Constants ¶
This section is empty.
Variables ¶
var SNS_MESSAGE_STRUCTURE string = "json"
var WORKER_POOL_SIZE int = 128
Functions ¶
func GenerateNotificationJson ¶
func GenerateNotificationJson(notification models.Notification) (string, error)
Generates the notification payload for SNS
func GetAllNotifications ¶
func GetAllNotifications(topics []string) ([]models.Notification, error)
Returns all notifications for the specified topics
func GetAllNotificationsForTopic ¶ added in v0.4.0
func GetAllNotificationsForTopic(topic string) ([]models.Notification, error)
Returns all notification for the specified topic
func GetAllPublicNotifications ¶ added in v0.4.0
func GetAllPublicNotifications() ([]models.Notification, error)
Returns all public notifications
func GetAllTopicIDs ¶ added in v0.4.0
Returns a list of all topic ids
func GetNotificationOrder ¶ added in v0.4.0
func GetNotificationOrder(id string) (*models.NotificationOrder, error)
Returns the notification order with the specified id
func GetNotificationRecipientArns ¶ added in v0.4.0
Returns a list of arns to receive a notification
func GetNotificationRecipients ¶ added in v0.4.0
Returns a list of userids to receive a notification to the specified topic
func GetSubscriptions ¶ added in v0.4.0
Returns the list of topics the user is subscribed to
func GetUserDevices ¶ added in v0.4.0
Gets the list of devices registered to a user
func GetUserRoles ¶ added in v0.4.0
Gets the roles for a given user
func GetUsersByRole ¶ added in v0.4.0
Gets the list of valid roles
func GetValidRoles ¶ added in v0.4.0
func GetValidRoles() (*models.UserRoleList, error)
Gets the list of valid roles
func Initialize ¶ added in v0.3.0
func Initialize() error
func PublishNotification ¶
Publishes the notification payload to all specified arns
func PublishNotificationToTopic ¶ added in v0.4.0
func PublishNotificationToTopic(notification models.Notification) (*models.NotificationOrder, error)
Publishes a notification to the specified topic
func PublishNotificationWorker ¶ added in v0.4.0
func PublishNotificationWorker(notification string, device_arns <-chan string, responses chan<- bool)
Worker go routine to publish notifications
func RegisterDeviceToUser ¶
Registers the device token with SNS and stores the arn with the associated user
func SetUserDevices ¶ added in v0.4.0
Sets the list of devices registered to a user
func SubscribeToTopic ¶ added in v0.4.0
Subscribes the user to the specified topic
func UnsubscribeToTopic ¶ added in v0.4.0
Unsubscribes the user to the specified topic
Types ¶
This section is empty.