summaryrefslogtreecommitdiff
path: root/internal/api/model
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2025-01-31 19:27:18 +0100
committerLibravatar GitHub <noreply@github.com>2025-01-31 19:27:18 +0100
commita55bd6d2bd7b11aed653f4614836caed4103bec3 (patch)
tree40ddcac7b495307d3c08c482455f88e3598952b6 /internal/api/model
parent[chore] Add "object" uri to outgoing Accept + Reject messages (#3717) (diff)
downloadgotosocial-a55bd6d2bd7b11aed653f4614836caed4103bec3.tar.xz
[feature] Add `instance-stats-randomize` config option (#3718)
* [feature] Add `instance-stats-randomize` config option * don't use cache (overkill)
Diffstat (limited to 'internal/api/model')
-rw-r--r--internal/api/model/instance.go13
-rw-r--r--internal/api/model/instancev1.go7
-rw-r--r--internal/api/model/instancev2.go7
3 files changed, 26 insertions, 1 deletions
diff --git a/internal/api/model/instance.go b/internal/api/model/instance.go
index d59424fa5..aaa01d837 100644
--- a/internal/api/model/instance.go
+++ b/internal/api/model/instance.go
@@ -17,7 +17,10 @@
package model
-import "mime/multipart"
+import (
+ "mime/multipart"
+ "time"
+)
// InstanceSettingsUpdateRequest models an instance update request.
//
@@ -148,3 +151,11 @@ type InstanceConfigurationEmojis struct {
// example: 51200
EmojiSizeLimit int `json:"emoji_size_limit"`
}
+
+// swagger:ignore
+type RandomStats struct {
+ Statuses int64
+ TotalUsers int64
+ MonthlyActiveUsers int64
+ Generated time.Time
+}
diff --git a/internal/api/model/instancev1.go b/internal/api/model/instancev1.go
index 6dedd04cc..57e32c80a 100644
--- a/internal/api/model/instancev1.go
+++ b/internal/api/model/instancev1.go
@@ -110,6 +110,13 @@ type InstanceV1 struct {
Terms string `json:"terms,omitempty"`
// Raw (unparsed) version of terms.
TermsRaw string `json:"terms_text,omitempty"`
+
+ // Random stats generated for the instance.
+ // Only used if `instance-stats-randomize` is true.
+ // Not serialized to the frontend.
+ //
+ // swagger:ignore
+ RandomStats `json:"-"`
}
// InstanceV1URLs models instance-relevant URLs for client application consumption.
diff --git a/internal/api/model/instancev2.go b/internal/api/model/instancev2.go
index b3d11dee2..96399ea06 100644
--- a/internal/api/model/instancev2.go
+++ b/internal/api/model/instancev2.go
@@ -74,6 +74,13 @@ type InstanceV2 struct {
Terms string `json:"terms,omitempty"`
// Raw (unparsed) version of terms.
TermsText string `json:"terms_text,omitempty"`
+
+ // Random stats generated for the instance.
+ // Only used if `instance-stats-randomize` is true.
+ // Not serialized to the frontend.
+ //
+ // swagger:ignore
+ RandomStats `json:"-"`
}
// Usage data for this instance.