Documentation
¶
Overview ¶
nolint
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsyncClient ¶
type AsyncClient struct {
// contains filtered or unexported fields
}
AsyncClient provides an enhanced asynchronous client for the FlexPrice API It builds on top of the FlexPrice Go SDK to provide batching and asynchronous event sending capabilities.
func (*AsyncClient) Enqueue ¶
func (c *AsyncClient) Enqueue(eventName, externalCustomerID string, properties map[string]interface{}) error
Enqueue adds an event to the processing queue
func (*AsyncClient) EnqueueWithOptions ¶
func (c *AsyncClient) EnqueueWithOptions(opts EventOptions) error
EnqueueWithOptions adds an event to the processing queue with additional options
func (*AsyncClient) Flush ¶
func (c *AsyncClient) Flush() error
Flush forces all queued events to be sent immediately
type AsyncConfig ¶
type AsyncConfig struct {
// BatchSize defines maximum number of events to batch before sending
BatchSize int
// FlushInterval defines how often the queue is flushed even if the batch size hasn't been reached
FlushInterval time.Duration
// MaxQueueSize is the maximum size of the queue before blocking
MaxQueueSize int
// MaxConcurrentRequests is the maximum number of concurrent API requests
MaxConcurrentRequests int
// DefaultSource is the default source to apply to events if not specified
DefaultSource string
// Debug enables debug logging
Debug bool
}
AsyncConfig provides configuration options for the enhanced FlexPrice client
func DefaultAsyncConfig ¶
func DefaultAsyncConfig() AsyncConfig
DefaultAsyncConfig returns a default configuration for the async client
type EventOptions ¶
type EventOptions struct {
// EventName is the name of the event (required)
EventName string
// ExternalCustomerID is the external customer ID (required)
ExternalCustomerID string
// CustomerID is the internal FlexPrice customer ID
CustomerID string
// EventID is a custom event ID
EventID string
// Properties contains event properties
Properties map[string]interface{}
// Source identifies the source of the event
Source string
// Timestamp is the event timestamp in RFC3339 format
Timestamp string
}
EventOptions provides all available options for adding an event
Click to show internal directories.
Click to hide internal directories.