Skip to content

Commit 77b975d

Browse files
committed
try fixing debug collects
1 parent 516fda6 commit 77b975d

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

client/gampops/debug_collect_responses.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,13 @@ func NewDebugCollectOK() *DebugCollectOK {
4545
Debug Report
4646
*/
4747
type DebugCollectOK struct {
48-
Payload []*models.HitParsingResult
48+
Payload Payload
49+
}
50+
51+
//Payload is payload received in DebugCollectOK
52+
type Payload struct {
53+
Payload []*models.HitParsingResult `json:"hitParsingResult"`
54+
ParserMsg []*models.ParserMessage `json:"parserMessage"`
4955
}
5056

5157
func (o *DebugCollectOK) Error() string {

gamp.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package gamp
22

33
import (
44
"context"
5+
"encoding/json"
56
"io"
67
"io/ioutil"
78

@@ -57,6 +58,12 @@ func New(ctx context.Context, tid string) *gampops.Client {
5758
return err
5859
})
5960

61+
transport.Consumers["application/javascript"] = runtime.ConsumerFunc(func(reader io.Reader, data interface{}) error {
62+
d, err := ioutil.ReadAll(reader)
63+
err = json.Unmarshal(d, &data)
64+
return err
65+
})
66+
6067
c := client.New(&wrapper{
6168
tid: tid,
6269
Limiter: rate.NewLimiter(30, 1),

0 commit comments

Comments
 (0)