Documentation ¶
Index ¶
- Constants
- type App
- type Command
- type CommandHandler
- type Notification
- type NotificationBroadcaster
- type NotificationRepository
- type SendError
- type Tag
- type Urgency
- type User
- func (u *User) GetLastNotifications(n int) []Notification
- func (u *User) GetNotificationCount() int
- func (u *User) GetNotifications(from int, to int) []Notification
- func (u *User) Receive(notification Notification)
- func (u *User) Respond(notification Notification, command Command)
- func (u *User) SubscribeToTag(tag *Tag)
- func (u *User) UnsubscribeFromTag(name string) error
Constants ¶
View Source
const ( NoTagsWhenSendErrorFormat = "no tags for %s#%s when sending %s" NoUsersInTagsWhenSendErrorFormat = "tags: %v for %s#%s did not have registered users when sending %s" )
View Source
const ( NoUserWhenBroadcastErrorMessage = "no users to broadcast to" NoMatchingTagsWhenRemoveErrorFormat = "tag %q not found" NoMatchingAppsWhenRemoveErrorFormat = "app %q not found" NoMatchingUsersWhenRemoveErrorFormat = "user %q not found" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct { ID string Name string IconURI string CommandChan chan Command // contains filtered or unexported fields }
func NewApp ¶
func NewApp(id, name, iconURI string, commandHandler CommandHandler) *App
func (*App) Send ¶
func (a *App) Send(notification Notification) error
type CommandHandler ¶
type CommandHandler interface {
HandleCommand(command Command)
}
type Notification ¶
type NotificationBroadcaster ¶
type NotificationBroadcaster interface { Broadcast(notification Notification) RegisterClient(connection interface{}) }
type NotificationRepository ¶
type NotificationRepository interface { SaveNotification(notification Notification) GetLastNotifications(n int) []Notification GetNotifications(from, to int) []Notification GetNotificationCount() int }
type SendError ¶
type SendError struct { *App Notification Tags []*Tag }
type Tag ¶
type Tag struct { Name string Users []*User Apps []*App NotificationChan chan Notification // contains filtered or unexported fields }
type User ¶
type User struct { ID string Username string NotificationChan chan Notification Tags []*Tag // contains filtered or unexported fields }
func NewUser ¶
func NewUser(id, username string, repo NotificationRepository, broadcaster NotificationBroadcaster) *User
func (*User) GetLastNotifications ¶
func (u *User) GetLastNotifications(n int) []Notification
func (*User) GetNotificationCount ¶
func (*User) GetNotifications ¶
func (u *User) GetNotifications(from int, to int) []Notification
func (*User) Receive ¶
func (u *User) Receive(notification Notification)
func (*User) Respond ¶
func (u *User) Respond(notification Notification, command Command)
func (*User) SubscribeToTag ¶
func (*User) UnsubscribeFromTag ¶
Click to show internal directories.
Click to hide internal directories.