Documentation
¶
Overview ¶
Package devicepush reaches the household's paired phones with a push: the notify and remind tools' out-of-band sender (Notifier) and the approval broker's waker (Waker). It is an adapter: it joins the device registry (internal/auth), the push providers (internal/push: APNs for iOS, FCM for Android) and the two consumers' interfaces, none of which know each other.
A push carries no authority. It is a wake, or a message the user already agreed to receive; an approval is always answered over the authenticated WebSocket the push makes the app open.
Index ¶
Constants ¶
const ( IOS = "ios" Android = "android" )
Platforms a device registers with, and so the provider that reaches it.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Devices ¶
type Devices interface {
PushTargets() []auth.PushTarget
}
Devices lists where a push can go. *auth.Store satisfies it.
type Notifier ¶
type Notifier struct {
// contains filtered or unexported fields
}
Notifier is the notify and remind tools' sender in daemon mode: it pushes the message to every paired device a provider reaches. Without a provider it logs that it would have, and succeeds.
func NewNotifier ¶
NewNotifier builds the notifier.
type Senders ¶
Senders maps a platform to the provider that reaches it. A platform without a sender is not pushed to; with no sender at all, push is off.