Documentation
¶
Overview ¶
Package gcm implements communication between master and slave for WebPush.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadVAPIDKey ¶
Types ¶
type Credential ¶
CredentialはWebPushサーバにアクセスする資格情報をあらわす。
type FailedMessage ¶
type FailedMessage struct {
// WebPushとは関係のない場所で発生したエラー(例えば"no such host")
ErrorString string
// WebPushプロトコルにおけるエラーの場合にセット
Detail *ProtocolError
// リクエストしたメッセージ
Message *Message
}
FailedMessageは送信失敗したメッセージとその理由をあらわす。 必ず、ErrorString、Detailはどれか1つだけセットされる。 なのでDetailを判定し、nilならErrorStringをエラーの理由として扱うこと。
type ProtocolError ¶
type ProtocolError struct {
StatusCode int
}
func (*ProtocolError) InvalidToken ¶
func (e *ProtocolError) InvalidToken() bool
type Request ¶
type Request struct {
Credential *Credential
Messages []*Message
BandWidth int32 // 1秒あたりの通知数(0以下なら無制限)
}
type Response ¶
type Response struct {
// 送信失敗したメッセージと理由。
// すべて成功した場合は空の配列。
FailedMessages []*FailedMessage
}
Responseはリクエストに対するスレーブからの応答をあらわす。
Click to show internal directories.
Click to hide internal directories.