-
Notifications
You must be signed in to change notification settings - Fork 6
/
domdebugger.go
704 lines (560 loc) · 18.8 KB
/
domdebugger.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
package protocol
import (
"encoding/json"
"github.com/yijinliu/algo-lib/go/src/logging"
hc "github.com/yijinliu/headless-chromium/go"
"sync"
)
// DOM breakpoint type.
type DOMBreakpointType string
const DOMBreakpointTypeSubtreeModified DOMBreakpointType = "subtree-modified"
const DOMBreakpointTypeAttributeModified DOMBreakpointType = "attribute-modified"
const DOMBreakpointTypeNodeRemoved DOMBreakpointType = "node-removed"
// Object event listener.
// @experimental
type EventListener struct {
Type string `json:"type"` // EventListener's type.
UseCapture bool `json:"useCapture"` // EventListener's useCapture.
Passive bool `json:"passive"` // EventListener's passive flag.
Once bool `json:"once"` // EventListener's once flag.
ScriptId *ScriptId `json:"scriptId"` // Script id of the handler code.
LineNumber int `json:"lineNumber"` // Line number in the script (0-based).
ColumnNumber int `json:"columnNumber"` // Column number in the script (0-based).
Handler *RemoteObject `json:"handler,omitempty"` // Event handler function value.
OriginalHandler *RemoteObject `json:"originalHandler,omitempty"` // Event original handler function value.
RemoveFunction *RemoteObject `json:"removeFunction,omitempty"` // Event listener remove function.
}
type SetDOMBreakpointParams struct {
NodeId *NodeId `json:"nodeId"` // Identifier of the node to set breakpoint on.
Type DOMBreakpointType `json:"type"` // Type of the operation to stop upon.
}
// Sets breakpoint on particular operation with DOM.
type SetDOMBreakpointCommand struct {
params *SetDOMBreakpointParams
wg sync.WaitGroup
err error
}
func NewSetDOMBreakpointCommand(params *SetDOMBreakpointParams) *SetDOMBreakpointCommand {
return &SetDOMBreakpointCommand{
params: params,
}
}
func (cmd *SetDOMBreakpointCommand) Name() string {
return "DOMDebugger.setDOMBreakpoint"
}
func (cmd *SetDOMBreakpointCommand) Params() interface{} {
return cmd.params
}
func (cmd *SetDOMBreakpointCommand) Run(conn *hc.Conn) error {
cmd.wg.Add(1)
conn.SendCommand(cmd)
cmd.wg.Wait()
return cmd.err
}
func SetDOMBreakpoint(params *SetDOMBreakpointParams, conn *hc.Conn) (err error) {
cmd := NewSetDOMBreakpointCommand(params)
cmd.Run(conn)
return cmd.err
}
type SetDOMBreakpointCB func(err error)
// Sets breakpoint on particular operation with DOM.
type AsyncSetDOMBreakpointCommand struct {
params *SetDOMBreakpointParams
cb SetDOMBreakpointCB
}
func NewAsyncSetDOMBreakpointCommand(params *SetDOMBreakpointParams, cb SetDOMBreakpointCB) *AsyncSetDOMBreakpointCommand {
return &AsyncSetDOMBreakpointCommand{
params: params,
cb: cb,
}
}
func (cmd *AsyncSetDOMBreakpointCommand) Name() string {
return "DOMDebugger.setDOMBreakpoint"
}
func (cmd *AsyncSetDOMBreakpointCommand) Params() interface{} {
return cmd.params
}
func (cmd *SetDOMBreakpointCommand) Done(data []byte, err error) {
cmd.err = err
cmd.wg.Done()
}
func (cmd *AsyncSetDOMBreakpointCommand) Done(data []byte, err error) {
cmd.cb(err)
}
type RemoveDOMBreakpointParams struct {
NodeId *NodeId `json:"nodeId"` // Identifier of the node to remove breakpoint from.
Type DOMBreakpointType `json:"type"` // Type of the breakpoint to remove.
}
// Removes DOM breakpoint that was set using setDOMBreakpoint.
type RemoveDOMBreakpointCommand struct {
params *RemoveDOMBreakpointParams
wg sync.WaitGroup
err error
}
func NewRemoveDOMBreakpointCommand(params *RemoveDOMBreakpointParams) *RemoveDOMBreakpointCommand {
return &RemoveDOMBreakpointCommand{
params: params,
}
}
func (cmd *RemoveDOMBreakpointCommand) Name() string {
return "DOMDebugger.removeDOMBreakpoint"
}
func (cmd *RemoveDOMBreakpointCommand) Params() interface{} {
return cmd.params
}
func (cmd *RemoveDOMBreakpointCommand) Run(conn *hc.Conn) error {
cmd.wg.Add(1)
conn.SendCommand(cmd)
cmd.wg.Wait()
return cmd.err
}
func RemoveDOMBreakpoint(params *RemoveDOMBreakpointParams, conn *hc.Conn) (err error) {
cmd := NewRemoveDOMBreakpointCommand(params)
cmd.Run(conn)
return cmd.err
}
type RemoveDOMBreakpointCB func(err error)
// Removes DOM breakpoint that was set using setDOMBreakpoint.
type AsyncRemoveDOMBreakpointCommand struct {
params *RemoveDOMBreakpointParams
cb RemoveDOMBreakpointCB
}
func NewAsyncRemoveDOMBreakpointCommand(params *RemoveDOMBreakpointParams, cb RemoveDOMBreakpointCB) *AsyncRemoveDOMBreakpointCommand {
return &AsyncRemoveDOMBreakpointCommand{
params: params,
cb: cb,
}
}
func (cmd *AsyncRemoveDOMBreakpointCommand) Name() string {
return "DOMDebugger.removeDOMBreakpoint"
}
func (cmd *AsyncRemoveDOMBreakpointCommand) Params() interface{} {
return cmd.params
}
func (cmd *RemoveDOMBreakpointCommand) Done(data []byte, err error) {
cmd.err = err
cmd.wg.Done()
}
func (cmd *AsyncRemoveDOMBreakpointCommand) Done(data []byte, err error) {
cmd.cb(err)
}
type SetEventListenerBreakpointParams struct {
EventName string `json:"eventName"` // DOM Event name to stop on (any DOM event will do).
TargetName string `json:"targetName,omitempty"` // EventTarget interface name to stop on. If equal to "*" or not provided, will stop on any EventTarget.
}
// Sets breakpoint on particular DOM event.
type SetEventListenerBreakpointCommand struct {
params *SetEventListenerBreakpointParams
wg sync.WaitGroup
err error
}
func NewSetEventListenerBreakpointCommand(params *SetEventListenerBreakpointParams) *SetEventListenerBreakpointCommand {
return &SetEventListenerBreakpointCommand{
params: params,
}
}
func (cmd *SetEventListenerBreakpointCommand) Name() string {
return "DOMDebugger.setEventListenerBreakpoint"
}
func (cmd *SetEventListenerBreakpointCommand) Params() interface{} {
return cmd.params
}
func (cmd *SetEventListenerBreakpointCommand) Run(conn *hc.Conn) error {
cmd.wg.Add(1)
conn.SendCommand(cmd)
cmd.wg.Wait()
return cmd.err
}
func SetEventListenerBreakpoint(params *SetEventListenerBreakpointParams, conn *hc.Conn) (err error) {
cmd := NewSetEventListenerBreakpointCommand(params)
cmd.Run(conn)
return cmd.err
}
type SetEventListenerBreakpointCB func(err error)
// Sets breakpoint on particular DOM event.
type AsyncSetEventListenerBreakpointCommand struct {
params *SetEventListenerBreakpointParams
cb SetEventListenerBreakpointCB
}
func NewAsyncSetEventListenerBreakpointCommand(params *SetEventListenerBreakpointParams, cb SetEventListenerBreakpointCB) *AsyncSetEventListenerBreakpointCommand {
return &AsyncSetEventListenerBreakpointCommand{
params: params,
cb: cb,
}
}
func (cmd *AsyncSetEventListenerBreakpointCommand) Name() string {
return "DOMDebugger.setEventListenerBreakpoint"
}
func (cmd *AsyncSetEventListenerBreakpointCommand) Params() interface{} {
return cmd.params
}
func (cmd *SetEventListenerBreakpointCommand) Done(data []byte, err error) {
cmd.err = err
cmd.wg.Done()
}
func (cmd *AsyncSetEventListenerBreakpointCommand) Done(data []byte, err error) {
cmd.cb(err)
}
type RemoveEventListenerBreakpointParams struct {
EventName string `json:"eventName"` // Event name.
TargetName string `json:"targetName,omitempty"` // EventTarget interface name.
}
// Removes breakpoint on particular DOM event.
type RemoveEventListenerBreakpointCommand struct {
params *RemoveEventListenerBreakpointParams
wg sync.WaitGroup
err error
}
func NewRemoveEventListenerBreakpointCommand(params *RemoveEventListenerBreakpointParams) *RemoveEventListenerBreakpointCommand {
return &RemoveEventListenerBreakpointCommand{
params: params,
}
}
func (cmd *RemoveEventListenerBreakpointCommand) Name() string {
return "DOMDebugger.removeEventListenerBreakpoint"
}
func (cmd *RemoveEventListenerBreakpointCommand) Params() interface{} {
return cmd.params
}
func (cmd *RemoveEventListenerBreakpointCommand) Run(conn *hc.Conn) error {
cmd.wg.Add(1)
conn.SendCommand(cmd)
cmd.wg.Wait()
return cmd.err
}
func RemoveEventListenerBreakpoint(params *RemoveEventListenerBreakpointParams, conn *hc.Conn) (err error) {
cmd := NewRemoveEventListenerBreakpointCommand(params)
cmd.Run(conn)
return cmd.err
}
type RemoveEventListenerBreakpointCB func(err error)
// Removes breakpoint on particular DOM event.
type AsyncRemoveEventListenerBreakpointCommand struct {
params *RemoveEventListenerBreakpointParams
cb RemoveEventListenerBreakpointCB
}
func NewAsyncRemoveEventListenerBreakpointCommand(params *RemoveEventListenerBreakpointParams, cb RemoveEventListenerBreakpointCB) *AsyncRemoveEventListenerBreakpointCommand {
return &AsyncRemoveEventListenerBreakpointCommand{
params: params,
cb: cb,
}
}
func (cmd *AsyncRemoveEventListenerBreakpointCommand) Name() string {
return "DOMDebugger.removeEventListenerBreakpoint"
}
func (cmd *AsyncRemoveEventListenerBreakpointCommand) Params() interface{} {
return cmd.params
}
func (cmd *RemoveEventListenerBreakpointCommand) Done(data []byte, err error) {
cmd.err = err
cmd.wg.Done()
}
func (cmd *AsyncRemoveEventListenerBreakpointCommand) Done(data []byte, err error) {
cmd.cb(err)
}
type SetInstrumentationBreakpointParams struct {
EventName string `json:"eventName"` // Instrumentation name to stop on.
}
// Sets breakpoint on particular native event.
// @experimental
type SetInstrumentationBreakpointCommand struct {
params *SetInstrumentationBreakpointParams
wg sync.WaitGroup
err error
}
func NewSetInstrumentationBreakpointCommand(params *SetInstrumentationBreakpointParams) *SetInstrumentationBreakpointCommand {
return &SetInstrumentationBreakpointCommand{
params: params,
}
}
func (cmd *SetInstrumentationBreakpointCommand) Name() string {
return "DOMDebugger.setInstrumentationBreakpoint"
}
func (cmd *SetInstrumentationBreakpointCommand) Params() interface{} {
return cmd.params
}
func (cmd *SetInstrumentationBreakpointCommand) Run(conn *hc.Conn) error {
cmd.wg.Add(1)
conn.SendCommand(cmd)
cmd.wg.Wait()
return cmd.err
}
func SetInstrumentationBreakpoint(params *SetInstrumentationBreakpointParams, conn *hc.Conn) (err error) {
cmd := NewSetInstrumentationBreakpointCommand(params)
cmd.Run(conn)
return cmd.err
}
type SetInstrumentationBreakpointCB func(err error)
// Sets breakpoint on particular native event.
// @experimental
type AsyncSetInstrumentationBreakpointCommand struct {
params *SetInstrumentationBreakpointParams
cb SetInstrumentationBreakpointCB
}
func NewAsyncSetInstrumentationBreakpointCommand(params *SetInstrumentationBreakpointParams, cb SetInstrumentationBreakpointCB) *AsyncSetInstrumentationBreakpointCommand {
return &AsyncSetInstrumentationBreakpointCommand{
params: params,
cb: cb,
}
}
func (cmd *AsyncSetInstrumentationBreakpointCommand) Name() string {
return "DOMDebugger.setInstrumentationBreakpoint"
}
func (cmd *AsyncSetInstrumentationBreakpointCommand) Params() interface{} {
return cmd.params
}
func (cmd *SetInstrumentationBreakpointCommand) Done(data []byte, err error) {
cmd.err = err
cmd.wg.Done()
}
func (cmd *AsyncSetInstrumentationBreakpointCommand) Done(data []byte, err error) {
cmd.cb(err)
}
type RemoveInstrumentationBreakpointParams struct {
EventName string `json:"eventName"` // Instrumentation name to stop on.
}
// Removes breakpoint on particular native event.
// @experimental
type RemoveInstrumentationBreakpointCommand struct {
params *RemoveInstrumentationBreakpointParams
wg sync.WaitGroup
err error
}
func NewRemoveInstrumentationBreakpointCommand(params *RemoveInstrumentationBreakpointParams) *RemoveInstrumentationBreakpointCommand {
return &RemoveInstrumentationBreakpointCommand{
params: params,
}
}
func (cmd *RemoveInstrumentationBreakpointCommand) Name() string {
return "DOMDebugger.removeInstrumentationBreakpoint"
}
func (cmd *RemoveInstrumentationBreakpointCommand) Params() interface{} {
return cmd.params
}
func (cmd *RemoveInstrumentationBreakpointCommand) Run(conn *hc.Conn) error {
cmd.wg.Add(1)
conn.SendCommand(cmd)
cmd.wg.Wait()
return cmd.err
}
func RemoveInstrumentationBreakpoint(params *RemoveInstrumentationBreakpointParams, conn *hc.Conn) (err error) {
cmd := NewRemoveInstrumentationBreakpointCommand(params)
cmd.Run(conn)
return cmd.err
}
type RemoveInstrumentationBreakpointCB func(err error)
// Removes breakpoint on particular native event.
// @experimental
type AsyncRemoveInstrumentationBreakpointCommand struct {
params *RemoveInstrumentationBreakpointParams
cb RemoveInstrumentationBreakpointCB
}
func NewAsyncRemoveInstrumentationBreakpointCommand(params *RemoveInstrumentationBreakpointParams, cb RemoveInstrumentationBreakpointCB) *AsyncRemoveInstrumentationBreakpointCommand {
return &AsyncRemoveInstrumentationBreakpointCommand{
params: params,
cb: cb,
}
}
func (cmd *AsyncRemoveInstrumentationBreakpointCommand) Name() string {
return "DOMDebugger.removeInstrumentationBreakpoint"
}
func (cmd *AsyncRemoveInstrumentationBreakpointCommand) Params() interface{} {
return cmd.params
}
func (cmd *RemoveInstrumentationBreakpointCommand) Done(data []byte, err error) {
cmd.err = err
cmd.wg.Done()
}
func (cmd *AsyncRemoveInstrumentationBreakpointCommand) Done(data []byte, err error) {
cmd.cb(err)
}
type SetXHRBreakpointParams struct {
Url string `json:"url"` // Resource URL substring. All XHRs having this substring in the URL will get stopped upon.
}
// Sets breakpoint on XMLHttpRequest.
type SetXHRBreakpointCommand struct {
params *SetXHRBreakpointParams
wg sync.WaitGroup
err error
}
func NewSetXHRBreakpointCommand(params *SetXHRBreakpointParams) *SetXHRBreakpointCommand {
return &SetXHRBreakpointCommand{
params: params,
}
}
func (cmd *SetXHRBreakpointCommand) Name() string {
return "DOMDebugger.setXHRBreakpoint"
}
func (cmd *SetXHRBreakpointCommand) Params() interface{} {
return cmd.params
}
func (cmd *SetXHRBreakpointCommand) Run(conn *hc.Conn) error {
cmd.wg.Add(1)
conn.SendCommand(cmd)
cmd.wg.Wait()
return cmd.err
}
func SetXHRBreakpoint(params *SetXHRBreakpointParams, conn *hc.Conn) (err error) {
cmd := NewSetXHRBreakpointCommand(params)
cmd.Run(conn)
return cmd.err
}
type SetXHRBreakpointCB func(err error)
// Sets breakpoint on XMLHttpRequest.
type AsyncSetXHRBreakpointCommand struct {
params *SetXHRBreakpointParams
cb SetXHRBreakpointCB
}
func NewAsyncSetXHRBreakpointCommand(params *SetXHRBreakpointParams, cb SetXHRBreakpointCB) *AsyncSetXHRBreakpointCommand {
return &AsyncSetXHRBreakpointCommand{
params: params,
cb: cb,
}
}
func (cmd *AsyncSetXHRBreakpointCommand) Name() string {
return "DOMDebugger.setXHRBreakpoint"
}
func (cmd *AsyncSetXHRBreakpointCommand) Params() interface{} {
return cmd.params
}
func (cmd *SetXHRBreakpointCommand) Done(data []byte, err error) {
cmd.err = err
cmd.wg.Done()
}
func (cmd *AsyncSetXHRBreakpointCommand) Done(data []byte, err error) {
cmd.cb(err)
}
type RemoveXHRBreakpointParams struct {
Url string `json:"url"` // Resource URL substring.
}
// Removes breakpoint from XMLHttpRequest.
type RemoveXHRBreakpointCommand struct {
params *RemoveXHRBreakpointParams
wg sync.WaitGroup
err error
}
func NewRemoveXHRBreakpointCommand(params *RemoveXHRBreakpointParams) *RemoveXHRBreakpointCommand {
return &RemoveXHRBreakpointCommand{
params: params,
}
}
func (cmd *RemoveXHRBreakpointCommand) Name() string {
return "DOMDebugger.removeXHRBreakpoint"
}
func (cmd *RemoveXHRBreakpointCommand) Params() interface{} {
return cmd.params
}
func (cmd *RemoveXHRBreakpointCommand) Run(conn *hc.Conn) error {
cmd.wg.Add(1)
conn.SendCommand(cmd)
cmd.wg.Wait()
return cmd.err
}
func RemoveXHRBreakpoint(params *RemoveXHRBreakpointParams, conn *hc.Conn) (err error) {
cmd := NewRemoveXHRBreakpointCommand(params)
cmd.Run(conn)
return cmd.err
}
type RemoveXHRBreakpointCB func(err error)
// Removes breakpoint from XMLHttpRequest.
type AsyncRemoveXHRBreakpointCommand struct {
params *RemoveXHRBreakpointParams
cb RemoveXHRBreakpointCB
}
func NewAsyncRemoveXHRBreakpointCommand(params *RemoveXHRBreakpointParams, cb RemoveXHRBreakpointCB) *AsyncRemoveXHRBreakpointCommand {
return &AsyncRemoveXHRBreakpointCommand{
params: params,
cb: cb,
}
}
func (cmd *AsyncRemoveXHRBreakpointCommand) Name() string {
return "DOMDebugger.removeXHRBreakpoint"
}
func (cmd *AsyncRemoveXHRBreakpointCommand) Params() interface{} {
return cmd.params
}
func (cmd *RemoveXHRBreakpointCommand) Done(data []byte, err error) {
cmd.err = err
cmd.wg.Done()
}
func (cmd *AsyncRemoveXHRBreakpointCommand) Done(data []byte, err error) {
cmd.cb(err)
}
type GetEventListenersParams struct {
ObjectId *RemoteObjectId `json:"objectId"` // Identifier of the object to return listeners for.
}
type GetEventListenersResult struct {
Listeners []*EventListener `json:"listeners"` // Array of relevant listeners.
}
// Returns event listeners of the given object.
// @experimental
type GetEventListenersCommand struct {
params *GetEventListenersParams
result GetEventListenersResult
wg sync.WaitGroup
err error
}
func NewGetEventListenersCommand(params *GetEventListenersParams) *GetEventListenersCommand {
return &GetEventListenersCommand{
params: params,
}
}
func (cmd *GetEventListenersCommand) Name() string {
return "DOMDebugger.getEventListeners"
}
func (cmd *GetEventListenersCommand) Params() interface{} {
return cmd.params
}
func (cmd *GetEventListenersCommand) Run(conn *hc.Conn) error {
cmd.wg.Add(1)
conn.SendCommand(cmd)
cmd.wg.Wait()
return cmd.err
}
func GetEventListeners(params *GetEventListenersParams, conn *hc.Conn) (result *GetEventListenersResult, err error) {
cmd := NewGetEventListenersCommand(params)
cmd.Run(conn)
return &cmd.result, cmd.err
}
type GetEventListenersCB func(result *GetEventListenersResult, err error)
// Returns event listeners of the given object.
// @experimental
type AsyncGetEventListenersCommand struct {
params *GetEventListenersParams
cb GetEventListenersCB
}
func NewAsyncGetEventListenersCommand(params *GetEventListenersParams, cb GetEventListenersCB) *AsyncGetEventListenersCommand {
return &AsyncGetEventListenersCommand{
params: params,
cb: cb,
}
}
func (cmd *AsyncGetEventListenersCommand) Name() string {
return "DOMDebugger.getEventListeners"
}
func (cmd *AsyncGetEventListenersCommand) Params() interface{} {
return cmd.params
}
func (cmd *GetEventListenersCommand) Result() *GetEventListenersResult {
return &cmd.result
}
func (cmd *GetEventListenersCommand) Done(data []byte, err error) {
if err == nil {
err = json.Unmarshal(data, &cmd.result)
}
cmd.err = err
cmd.wg.Done()
}
func (cmd *AsyncGetEventListenersCommand) Done(data []byte, err error) {
var result GetEventListenersResult
if err == nil {
err = json.Unmarshal(data, &result)
}
if cmd.cb == nil {
logging.Vlog(-1, err)
} else if err != nil {
cmd.cb(nil, err)
} else {
cmd.cb(&result, nil)
}
}