...

Source file src/github.com/launchdarkly/go-server-sdk/v6/internal/sharedtest/mocks/spy_event_processor.go

Documentation: github.com/launchdarkly/go-server-sdk/v6/internal/sharedtest/mocks

     1  package mocks
     2  
     3  import (
     4  	"encoding/json"
     5  	"time"
     6  
     7  	ldevents "github.com/launchdarkly/go-sdk-events/v2"
     8  )
     9  
    10  // CapturingEventProcessor is a test implementation of EventProcessor that accumulates all events.
    11  type CapturingEventProcessor struct {
    12  	Events []interface{}
    13  }
    14  
    15  func (c *CapturingEventProcessor) RecordEvaluation(e ldevents.EvaluationData) { //nolint:revive
    16  	c.Events = append(c.Events, e)
    17  }
    18  
    19  func (c *CapturingEventProcessor) RecordIdentifyEvent(e ldevents.IdentifyEventData) { //nolint:revive
    20  	c.Events = append(c.Events, e)
    21  }
    22  
    23  func (c *CapturingEventProcessor) RecordCustomEvent(e ldevents.CustomEventData) { //nolint:revive
    24  	c.Events = append(c.Events, e)
    25  }
    26  
    27  func (c *CapturingEventProcessor) RecordRawEvent(e json.RawMessage) { //nolint:revive
    28  	c.Events = append(c.Events, e)
    29  }
    30  
    31  func (c *CapturingEventProcessor) Flush() {} //nolint:revive
    32  
    33  func (c *CapturingEventProcessor) FlushBlocking(time.Duration) bool { return true } //nolint:revive
    34  
    35  func (c *CapturingEventProcessor) Close() error { //nolint:revive
    36  	return nil
    37  }
    38  

View as plain text