service

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2019 License: NCSA Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const APPLICATION_PROTOCOL = "application"
View Source
const MESSAGE_STRUCTURE = "json"

Variables

This section is empty.

Functions

func AddUsersToTopic

func AddUsersToTopic(topic_name string, userid_list models.UserIDList) error

Adds the given userids to the specified topic

func CreateTopic

func CreateTopic(name string) error

Creates an SNS Topic

func DeleteTopic

func DeleteTopic(name string) error

Deletes an SNS Topic

func GenerateNotificationJson

func GenerateNotificationJson(notification models.Notification) (*string, error)

func GetAllDevices

func GetAllDevices() (*[]models.Device, error)

Returns a list of registered devices

func GetAllNotifications

func GetAllNotifications() (*models.NotificationList, error)

Returns a list of available SNS Topics

func GetAllTopics

func GetAllTopics() (*models.TopicList, error)

Returns a list of available SNS Topics

func GetNotificationsForTopic

func GetNotificationsForTopic(topic_name string) (*models.NotificationList, error)

func GetTopicInfo

func GetTopicInfo(name string) (*models.Topic, error)

func PublishNotification

func PublishNotification(topic_name string, notification models.Notification) (*models.PastNotification, error)

Dispatches a notification to a given SNS Topic

func RegisterDeviceToUser

func RegisterDeviceToUser(user_id string, device_reg models.DeviceRegistration) error

Links the given device token with a user

func RemoveUsersFromTopic

func RemoveUsersFromTopic(topic_name string, userid_list models.UserIDList) error

Removes the given userids from the specified topic

func SubscribeDeviceToTopic

func SubscribeDeviceToTopic(topic models.Topic, device models.Device) error

Subscribes a given Device to a Topic, in the database and SNS

func UnsubscribeDeviceFromTopic

func UnsubscribeDeviceFromTopic(topic models.Topic, device models.Device) error

Unsubscribes a given Device from a Topic, both in the database and SNS

Types

This section is empty.

Jump to

Keyboard shortcuts

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