Documentation
¶
Overview ¶
Provides methods for creating and modifying preferenfes
Index ¶
- func AddChannel(ident, channelName, user, organization string) error
- func ChannelAllowed(user, org, app_name, ident, channelName string) bool
- func DisableUserChannel(orgs, topics []string, user, channelName string)
- func Get(user, org, topicName string) (topic *db.Topic, err error)
- func GetAllDefault(org string) []db.Topic
- func Initialize(user, org string) error
- func Insert(topic *db.Topic) string
- func InsertOrUpdateTopic(org, ident, channelName, attr string, val bool, user string) error
- func RemoveChannel(ident, channelName, user, organization string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddChannel ¶
AddChannel enables the channel for that particular ident for sending notifications
func ChannelAllowed ¶
ChannelAllowed checks if the requested channel is allowed by the user for sending out the notification
func DisableUserChannel ¶
func GetAllDefault ¶
GetAllDefault returns all the "default - non-enabled" preferences for the organization
func Initialize ¶
Initialize creates a list of "default - non-enabled" preferences for user or org
func InsertOrUpdateTopic ¶
InsertOrUpdateTopic adds a topic in `topics` collection if it doesn't exist Or it update the topic if it exists
This is not a very effecient way of doing it but we are doing it at the cost of the data structure we want.
One of the limitations is that mongo is not yet capable of upserting to array of documents. For this to happen in a simple way the data structure has to change from channels: []Channel to channels: map[string]interface
func RemoveChannel ¶
RemoveChannel disables the channel for that particular ident for sending notifications
Types ¶
This section is empty.