notification

package
v0.0.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

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 NotificationContent struct {
	Title string `json:"title"`
	Body  string `json:"body"`
	Sound string `json:"sound"`
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL