# README
LaunchDarkly Go SDK Events Engine
Overview
This repository contains the internal analytics event logic and event data model used by the LaunchDarkly Go SDK. It is packaged separately because it is also used by internal LaunchDarkly components. Applications using the LaunchDarkly Go SDK should not need to reference this package directly.
Supported Go versions
This version of the project requires a Go version of 1.18 or higher.
Learn more
Read our documentation for in-depth instructions on configuring and using LaunchDarkly. You can also head straight to the complete reference guide for the Go SDK, or the generated API documentation for this project.
Contributing
We encourage pull requests and other contributions from the community. Check out our contributing guidelines for instructions on how to contribute to this SDK.
About LaunchDarkly
- LaunchDarkly is a continuous delivery platform that provides feature flags as a service and allows developers to iterate quickly and safely. We allow you to easily flag your features and manage them from the LaunchDarkly dashboard. With LaunchDarkly, you can:
- Roll out a new feature to a subset of your users (like a group of users who opt-in to a beta tester group), gathering feedback and bug reports from real-world use cases.
- Gradually roll out a feature to an increasing percentage of users, and track the effect that the feature has on key metrics (for instance, how likely is a user to complete a purchase if they have feature A versus feature B?).
- Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy, or even restart the application with a changed configuration file.
- Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan). Disable parts of your application to facilitate maintenance, without taking everything offline.
- LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Read our documentation for a complete list.
- Explore LaunchDarkly
- launchdarkly.com for more information
- docs.launchdarkly.com for our documentation and SDK reference guides
- apidocs.launchdarkly.com for our API documentation
- blog.launchdarkly.com for the latest product updates
# Functions
Context creates an EventInputContext that is exactly equivalent to the given Context.
NewDefaultEventProcessor creates an instance of the default implementation of analytics event processing.
NewDiagnosticID creates a unique identifier for this SDK instance.
NewDiagnosticsManager creates an instance of DiagnosticsManager.
NewEventFactory creates an EventFactory.
NewNullEventProcessor creates a no-op implementation of EventProcessor.
NewServerSideEventSender creates the standard implementation of EventSender for server-side SDKs.
PreserializedContext creates an EventInputContext that contains both a Context and its already-computed JSON representation.
SendEventDataWithRetry provides an entry point to the same event delivery logic that is used by DefaultEventSender.
# Constants
AnalyticsEventDataKind denotes a payload of analytics event data.
Event types.
DefaultDiagnosticRecordingInterval is the default value for EventsConfiguration.DiagnosticRecordingInterval.
DefaultFlushInterval is the default value for EventsConfiguration.FlushInterval.
DefaultUserKeysFlushInterval is the default value for EventsConfiguration.UserKeysFlushInterval.
DiagnosticEventDataKind denotes a payload of diagnostic event data.
Event types.
Event types.
Event types.
Event types.
Event types.
MinimumDiagnosticRecordingInterval is the minimum value for EventsConfiguration.DiagnosticRecordingInterval.
Event types.
# Structs
BaseEvent provides properties common to all events.
CustomEventData is generated by calling the client's Track method.
DiagnosticsManager is an object that maintains state for diagnostic events and produces JSON data.
EvaluationData is generated by evaluating a feature flag or one of a flag's prerequisites.
EventFactory is a configurable factory for event objects.
EventInputContext represents context information that is being used as part of the inputs to an event-generating action.
EventsConfiguration contains options affecting the behavior of the events engine.
EventSenderConfiguration contains parameters for event delivery that do not vary from one event payload to another.
EventSenderResult is the return type for EventSender.SendEventData.
FlagEventProperties contains basic information about a feature flag that the events package needs.
IdentifyEventData is generated by calling the client's Identify method.
MigrationOpEventData is generated through the migration op tracker provided through the SDK.
# Interfaces
EventProcessor defines the interface for dispatching analytics events.
EventSender defines the interface for delivering already-formatted analytics event data to the events service.
# Type aliases
EventDataKind is a parameter passed to EventSender to indicate the type of event data payload.