mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 04:30:05 +00:00
feat: update to go1.24 & support listening https (#1002)
* feat: support listening https * refactor * modernize * support snake case in config * more precise control of config fields * update goreleaser config * remove kubeyaml * fix: expose agent_secret * chore
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/goccy/go-json"
|
||||
"github.com/gorilla/websocket"
|
||||
"github.com/hashicorp/go-uuid"
|
||||
"golang.org/x/sync/singleflight"
|
||||
@@ -157,7 +158,7 @@ func serverStream(c *gin.Context) (any, error) {
|
||||
var requestGroup singleflight.Group
|
||||
|
||||
func getServerStat(withPublicNote, authorized bool) ([]byte, error) {
|
||||
v, err, _ := requestGroup.Do(fmt.Sprintf("serverStats::%t", authorized), func() (interface{}, error) {
|
||||
v, err, _ := requestGroup.Do(fmt.Sprintf("serverStats::%t", authorized), func() (any, error) {
|
||||
var serverList []*model.Server
|
||||
if authorized {
|
||||
serverList = singleton.ServerShared.GetSortedList()
|
||||
@@ -183,7 +184,7 @@ func getServerStat(withPublicNote, authorized bool) ([]byte, error) {
|
||||
})
|
||||
}
|
||||
|
||||
return utils.Json.Marshal(model.StreamServerData{
|
||||
return json.Marshal(model.StreamServerData{
|
||||
Now: time.Now().Unix() * 1000,
|
||||
Online: singleton.GetOnlineUserCount(),
|
||||
Servers: servers,
|
||||
|
||||
Reference in New Issue
Block a user