Documentation ¶
Overview ¶
Package molasses is a Go SDK for Molasses. It allows you to evaluate user's status for a feature. It also helps simplify logging events for A/B testing.
Molasses uses polling to check if you have updated features. Once initialized, it takes microseconds to evaluate if a user is active.
Index ¶
- type Client
- func (c *Client) ExperimentStarted(key string, user User, additionalDetails map[string]interface{})
- func (c *Client) ExperimentSuccess(key string, user User, additionalDetails map[string]interface{})
- func (c *Client) IsActive(key string, user ...User) bool
- func (c *Client) IsInitiated() bool
- func (c *Client) Stop()
- func (c *Client) Track(eventName string, user User, additionalDetails map[string]interface{})
- type ClientInterface
- type ClientOptions
- type HttpClient
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ExperimentStarted ¶ added in v0.4.0
func (*Client) ExperimentSuccess ¶ added in v0.2.0
func (*Client) IsActive ¶
IsActive - Check to see if a feature is active for a user. You must pass the key of the feature (ex. SHOW_USER_ONBOARDING) and optionally pass the user who you are evaluating. if you pass more than 1 user value, the first will only be evaluated
func (*Client) IsInitiated ¶ added in v0.2.0
func (c *Client) IsInitiated() bool
type ClientInterface ¶ added in v0.2.0
type ClientInterface interface { IsActive(key string, user ...User) bool Stop() IsInitiated() bool Track(eventName string, user User, additionalDetails map[string]interface{}) ExperimentStarted(key string, user User, additionalDetails map[string]interface{}) ExperimentSuccess(key string, user User, additionalDetails map[string]interface{}) }
func Init ¶
func Init(options ClientOptions) (ClientInterface, error)
Init - Creates a new client to interface with Molasses. Receives a ClientOptions
type ClientOptions ¶
type ClientOptions struct { APIKey string // APIKey is the required field. URL string // URL can be updated if you are using a hosted version of Molasses Debug bool // Debug - whether to log debug info HTTPClient HttpClient // HTTPClient - Pass in your own http client AutoSendEvents bool Polling bool }
ClientOptions - The options for the Molasses client to start, the APIKey is required