From ec55bf1878dc4ee3ed5885abe1252462ec9de7d6 Mon Sep 17 00:00:00 2001 From: Vladislav Veselskiy Date: Mon, 27 Jan 2025 14:08:21 +0300 Subject: [PATCH] Add structs for server info. --- server.go | 25 +++++++++++++++++++++++++ util.go | 8 -------- 2 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 server.go diff --git a/server.go b/server.go new file mode 100644 index 0000000..a3fdcc2 --- /dev/null +++ b/server.go @@ -0,0 +1,25 @@ +package push_common + +type ServerInfo struct { + RevisionHash string `json:"revisionHash"` + Time uint32 `json:"time"` + Hostname string `json:"hostname"` + RedisConnectionConf *RedisConnectionConf `json:"redisConnectionConf"` + ActivePushAmount uint32 `json:"activePushAmount"` + UptraceInfo *UptraceInfo `json:"uptraceInfo"` +} + +type RedisConnectionConf struct { + Host string `json:"host"` + Port int `json:"port"` + Db int `json:"db"` + Prefix string `json:"prefix"` +} + +type UptraceInfo struct { + UptraceOn bool `json:"uptraceOn"` + UptraceDSN string `json:"uptraceDSN"` + ServiceName string `json:"serviceName"` + ServiceVersion string `json:"serviceVersion"` + DeploymentEnvironment string `json:"deploymentEnvironment"` +} diff --git a/util.go b/util.go index 107ba8b..2f3c6cd 100644 --- a/util.go +++ b/util.go @@ -5,11 +5,3 @@ import "strconv" func uint32ToString(n uint32) string { return strconv.FormatUint(uint64(n), 10) } - -type UptraceInfo struct { - UptraceOn bool `json:"uptraceOn"` - UptraceDSN string `json:"uptraceDSN"` - ServiceName string `json:"serviceName"` - ServiceVersion string `json:"serviceVersion"` - DeploymentEnvironment string `json:"deploymentEnvironment"` -}