Documentation ¶
Index ¶
Constants ¶
const EmptyMapper = emptyMapper(0)
EmptyMapper is a Mapper which always returns a empty map.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APNSPusher ¶
type APNSPusher struct {
// contains filtered or unexported fields
}
APNSPusher pushes notification via apns
func NewAPNSPusher ¶
func NewAPNSPusher(connOpener func() (skydb.Conn, error), gwType GatewayType, cert string, key string) (*APNSPusher, error)
NewAPNSPusher returns a new APNSPusher from content of certificate and private key as string
func (*APNSPusher) Run ¶
func (pusher *APNSPusher) Run()
Run listens to the notification error channel
func (*APNSPusher) RunFeedback ¶
func (pusher *APNSPusher) RunFeedback()
RunFeedback kicks start receiving from the Feedback Service.
The checking behaviour is to:
- Receive once on startup
- Receive once at 00:00:00 everyday
type GCMPusher ¶
type GCMPusher struct {
APIKey string
}
GCMPusher sends push notifications via GCM.
type GatewayType ¶
type GatewayType string
GatewayType determine which kind of gateway should be used for APNS
const ( Sandbox GatewayType = "sandbox" Production = "production" )
Available gateways
type MapMapper ¶
type MapMapper map[string]interface{}
MapMapper is a string-interface map that implemented the Mapper interface.
type Mapper ¶
type Mapper interface { // Implementor of Map should return a string-interface map which // all values are JSON-marshallable Map() map[string]interface{} }
Mapper defines a single method Map()
type RouteSender ¶
type RouteSender struct {
// contains filtered or unexported fields
}
RouteSender routes notifications to registered senders that is capable of sending them. RouteSender itself doesn't send notifications.
func (RouteSender) Len ¶
func (s RouteSender) Len() int
Len returns the number of services registered with sender.
func (RouteSender) Route ¶
func (s RouteSender) Route(service string, sender Sender)
Route registers a sender to handle notifications sent via a certain Push Notification Service.