# README
optimizely-sdk-go
This project aims to provide an SDK for interacting with Optimizely full stack in Go.
This project is in early development stages and does not implement the full feature-set of the official Optimizely SDKs for other languages nor is it officially endorsed by Optimizely. PRs for feature additions and bug fixes are welcome!
Supported features:
- Basic A/B test bucketing
- Impression reporting
- Read Projects, Environments, and Datafiles from the REST API
- Audiences
- Mutual Exclusion
- Feature tests
# Functions
ActivatedImpression adds the variation impression to the set of reported events.
AnonymizeIP sets the anonymize IP flag on the events.
ClientName sets the client name property on the events.
ClientVersion overrides the client version of this library.
EnrichDecisions sets the enrich decisions property on the events.
EventsFromContext creates Events from all the impressions that were seen during the lifecycle of the provided context.
GetDatafile is a convenience wrapper around the api package's GetDatafile method that unmarshals the datafile from the Optimizely API.
GetVariation returns the variation, if applicable, for the given experiment name from the project and user ID stored in the context.
NewEvents constructs a set of reportable events from the provided options.
NewProjectFromDataFile creates a new Optimizely project given the raw JSON datafile.
ReportEvents is a convenience wrapper for sending events to the Optimizely reporting API that marshals the events to JSON and calls the api package.
# Structs
Datafile used for loading the JSON datafile from Optimizely.
DatafileExperiment is the structure of the experiment within a datafile.
DatafileTrafficAllocation is the structure of the traffic allocation with a datafile.
DatafileVariation is an experiment variation within a datafile used for deserialization.
Experiment represents a single Optimizely experiment.
Impression is the outcome of bucketing a user into a specific variation.
Project is an Optimizely project containing a set of experiments.
Variation represents a variation of an Optimizely experiment.
# Type aliases
Events are reportable actions back to the Optimizely API.