Documentation
¶
Overview ¶
--- File: pkg/notification/v1/notification.go ---
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NotificationContent ¶
type NotificationRequest ¶
type NotificationRequest struct {
RecipientID urn.URN `json:"recipientId"`
FCMTokens []string `json:"fcmTokens"`
WebSubscriptions []WebPushSubscription `json:"webSubscriptions"`
Content NotificationContent `json:"content"`
DataPayload map[string]string `json:"dataPayload"`
}
... (NotificationRequest remains unchanged) ...
func NotificationRequestFromProto ¶
func NotificationRequestFromProto(protoReq *NotificationRequestPb) (*NotificationRequest, error)
type NotificationRequestPb ¶
type NotificationRequestPb = nv1.NotificationRequestPb
Re-export the Protobuf types.
func NotificationRequestToProto ¶
func NotificationRequestToProto(nativeReq *NotificationRequest) *NotificationRequestPb
... (Existing NotificationRequestToProto / FromProto functions remain unchanged) ...
type WebPushSubscription ¶ added in v0.0.13
type WebPushSubscription struct {
Endpoint string `json:"endpoint"`
Keys struct {
P256dh []byte `json:"p256dh"`
Auth []byte `json:"auth"`
} `json:"keys"`
}
func (WebPushSubscription) MarshalJSON ¶ added in v0.0.17
func (w WebPushSubscription) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface. It maps the domain struct to the Proto, then uses protojson to generate the wire format.
func (*WebPushSubscription) UnmarshalJSON ¶ added in v0.0.17
func (w *WebPushSubscription) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface. It uses protojson to parse the wire format strictly, then maps it to the domain struct.
type WebPushSubscriptionPb ¶ added in v0.0.13
type WebPushSubscriptionPb = nv1.WebPushSubscriptionPb
Click to show internal directories.
Click to hide internal directories.