service

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2019 License: NCSA Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SNS_MESSAGE_STRUCTURE string = "json"
View Source
var WORKER_POOL_SIZE int = 128

Functions

func CreateTopic

func CreateTopic(id string) error

Creates a topic

func DeleteTopic

func DeleteTopic(id string) error

Deletes a topic

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

func GetAllTopicIDs() ([]string, error)

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

func GetNotificationRecipientArns(userIds []string) ([]string, error)

Returns a list of arns to receive a notification

func GetNotificationRecipients added in v0.4.0

func GetNotificationRecipients(topicId string) ([]string, error)

Returns a list of userids to receive a notification to the specified topic

func GetSubscriptions added in v0.4.0

func GetSubscriptions(id string) ([]string, error)

Returns the list of topics the user is subscribed to

func GetTopic added in v0.4.0

func GetTopic(id string) (*models.Topic, error)

Returns the topic with the specified id

func GetUserDevices added in v0.4.0

func GetUserDevices(id string) ([]string, error)

Gets the list of devices registered to a user

func GetUserRoles added in v0.4.0

func GetUserRoles(id string) ([]string, error)

Gets the roles for a given user

func GetUsersByRole added in v0.4.0

func GetUsersByRole(role string) ([]string, error)

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

func PublishNotification(id string, payload string, arns []string) error

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

func RegisterDeviceToUser(token string, platform string, id string) error

Registers the device token with SNS and stores the arn with the associated user

func SetUserDevices added in v0.4.0

func SetUserDevices(id string, devices []string) error

Sets the list of devices registered to a user

func SubscribeToTopic added in v0.4.0

func SubscribeToTopic(userId string, topicId string) error

Subscribes the user to the specified topic

func UnsubscribeToTopic added in v0.4.0

func UnsubscribeToTopic(userId string, topicId string) error

Unsubscribes the user to the specified topic

Types

This section is empty.

Jump to

Keyboard shortcuts

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