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 interface { Sender Start() Stop() // contains filtered or unexported methods }
APNSPusher defines an interface of APNS Pusher
func NewCertBasedAPNSPusher ¶ added in v0.21.0
func NewCertBasedAPNSPusher( connOpener func() (skydb.Conn, error), gatewayType GatewayType, cert string, key string, keepalive int, ) (APNSPusher, error)
NewCertBasedAPNSPusher returns a new APNSPusher from content of certificate and private key as string
func NewTokenBasedAPNSPusher ¶ added in v0.21.0
func NewTokenBasedAPNSPusher( connOpener func() (skydb.Conn, error), gatewayType GatewayType, teamID string, keyID string, key string, keepalive int, ) (APNSPusher, error)
NewTokenBasedAPNSPusher creates a new APNSPusher from the content of auth key
type BaiduAndroidPushMessage ¶ added in v1.4.0
type BaiduAndroidPushMessage struct { Msg baidu.AndroidNotificationMsg `json:"msg"` MsgExpires int `json:"msg_expires"` }
type BaiduPusher ¶ added in v1.4.0
type BaiduPusher struct {
// contains filtered or unexported fields
}
func NewBaiduPusher ¶ added in v1.4.0
func NewBaiduPusher(apiKey string, secretKey string) *BaiduPusher
type FCMPusher ¶ added in v0.25.0
type FCMPusher struct { ServiceAccountKey string // contains filtered or unexported fields }
FCMPusher sends push notifications via FCM.
func NewFCMPusher ¶ added in v1.7.0
type GatewayType ¶
type GatewayType string
GatewayType determine which kind of gateway should be used for APNS
const ( Sandbox GatewayType = "sandbox" Production GatewayType = "production" )
Available gateways
type LegacyFCMPusher ¶ added in v0.25.0
type LegacyFCMPusher struct {
APIKey string
}
LegacyFCMPusher sends push notifications via GCM.
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.