mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-08-02 16:08:31 +00:00
switch to gorilla/websocket, post aggregate data
This commit is contained in:
parent
9c4891db9f
commit
9f1c369fdb
7 changed files with 192 additions and 112 deletions
|
@ -22,6 +22,7 @@ var backendUrl string
|
|||
var responseCache *cache.Cache
|
||||
|
||||
var getBacklogUrl string
|
||||
var postStatisticsUrl string
|
||||
|
||||
var backendSharedKey [32]byte
|
||||
var serverId int
|
||||
|
@ -37,6 +38,7 @@ func SetupBackend(config *ConfigFile) {
|
|||
responseCache = cache.New(60*time.Second, 120*time.Second)
|
||||
|
||||
getBacklogUrl = fmt.Sprintf("%s/backlog", backendUrl)
|
||||
postStatisticsUrl = fmt.Sprintf("%s/stats", backendUrl)
|
||||
|
||||
messageBufferPool.New = New4KByteBuffer
|
||||
|
||||
|
@ -155,6 +157,15 @@ func RequestRemoteData(remoteCommand, data string, auth AuthInfo) (responseStr s
|
|||
return
|
||||
}
|
||||
|
||||
func SendAggregatedData(sealedForm url.Values) (error) {
|
||||
resp, err := backendHttpClient.PostForm(postStatisticsUrl, sealedForm)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return resp.Body.Close()
|
||||
}
|
||||
|
||||
func FetchBacklogData(chatSubs []string) ([]ClientMessage, error) {
|
||||
formData := url.Values{
|
||||
"subs": chatSubs,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue