types

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2021 License: ISC Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DynamicConfig

type DynamicConfig struct {
	Name   string                 `json:"name"`
	Value  map[string]interface{} `json:"value"`
	RuleID string                 `json:"rule_id"`
}

A json blob configured in the Statsig Console

func NewConfig

func NewConfig(name string, value map[string]interface{}, ruleID string) *DynamicConfig

func (*DynamicConfig) GetBool

func (d *DynamicConfig) GetBool(key string, fallback bool) bool

Gets the boolean value at the given key in the DynamicConfig Returns the fallback boolean if the item at the given key is not found or not of type boolean

func (*DynamicConfig) GetNumber

func (d *DynamicConfig) GetNumber(key string, fallback float64) float64

Gets the float64 value at the given key in the DynamicConfig Returns the fallback float64 if the item at the given key is not found or not of type float64

func (*DynamicConfig) GetSlice

func (d *DynamicConfig) GetSlice(key string, fallback []interface{}) []interface{}

Gets the slice value at the given key in the DynamicConfig Returns the fallback slice if the item at the given key is not found or not of type slice

func (*DynamicConfig) GetString

func (d *DynamicConfig) GetString(key string, fallback string) string

Gets the string value at the given key in the DynamicConfig Returns the fallback string if the item at the given key is not found or not of type string

type StatsigEnvironment

type StatsigEnvironment struct {
	Tier   string
	Params map[string]string
}

See https://docs.statsig.com/guides/usingEnvironments

type StatsigEvent

type StatsigEvent struct {
	EventName string            `json:"eventName"`
	User      StatsigUser       `json:"user"`
	Value     string            `json:"value"`
	Metadata  map[string]string `json:"metadata"`
}

A log event sent to Statsig for analysis

type StatsigOptions

type StatsigOptions struct {
	API         string
	Environment StatsigEnvironment
}

Advanced options for configuring the Statsig SDK

type StatsigUser

type StatsigUser struct {
	UserID             string                 `json:"userID"`
	Email              string                 `json:"email"`
	IpAddress          string                 `json:"ip"`
	UserAgent          string                 `json:"userAgent"`
	Country            string                 `json:"country"`
	Locale             string                 `json:"locale"`
	AppVersion         string                 `json:"appVersion"`
	Custom             map[string]interface{} `json:"custom"`
	StatsigEnvironment map[string]string      `json:"statsigEnvironment"`
}

User specific attributes for evaluating Feature Gates, Experiments, and DyanmicConfigs NOTE: UserID is **required** - see https://docs.statsig.com/messages/serverRequiredUserID

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL