summaryrefslogtreecommitdiff
path: root/internal/cache/size.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/cache/size.go')
-rw-r--r--internal/cache/size.go18
1 files changed, 17 insertions, 1 deletions
diff --git a/internal/cache/size.go b/internal/cache/size.go
index 24101683a..c96a3cd2e 100644
--- a/internal/cache/size.go
+++ b/internal/cache/size.go
@@ -66,6 +66,14 @@ you'll make society more equitable for all if you're not careful! :hammer_sickle
// be a serialized string of almost any type, so we pick a
// nice serialized key size on the upper end of normal.
sizeofResultKey = 2 * sizeofIDStr
+
+ // exampleWebPushAuth is a Base64-encoded 16-byte random auth secret.
+ // This secret is consumed as Base64 by webpush-go.
+ exampleWebPushAuth = "ZVxqlt5fzVgmSz2aqiA2XQ=="
+
+ // exampleWebPushP256dh is a Base64-encoded DH P-256 public key.
+ // This secret is consumed as Base64 by webpush-go.
+ exampleWebPushP256dh = "OrpejO16gV97uBXew/T0I7YoUv/CX8fz0z4g8RrQ+edXJqQPjX3XVSo2P0HhcCpCOR1+Dzj5LFcK9jYNqX7SBg=="
)
var (
@@ -576,7 +584,7 @@ func sizeofMove() uintptr {
func sizeofNotification() uintptr {
return uintptr(size.Of(&gtsmodel.Notification{
ID: exampleID,
- NotificationType: gtsmodel.NotificationFave,
+ NotificationType: gtsmodel.NotificationFavourite,
CreatedAt: exampleTime,
TargetAccountID: exampleID,
OriginAccountID: exampleID,
@@ -821,3 +829,11 @@ func sizeofUserMute() uintptr {
Notifications: util.Ptr(false),
}))
}
+
+func sizeofWebPushSubscription() uintptr {
+ return uintptr(size.Of(&gtsmodel.WebPushSubscription{
+ TokenID: exampleID,
+ Auth: exampleWebPushAuth,
+ P256dh: exampleWebPushP256dh,
+ }))
+}