Documentation ¶
Index ¶
- func ContainsProjectId(slice []ProjectId, item ProjectId) bool
- func DecodeTreatmentConfig(config *structpb.Struct) map[string]interface{}
- func ExperimentTreatmentToOpenAPITreatment(treatment *_pubsub.ExperimentTreatment) schema.SelectedTreatmentData
- func OpenAPIExperimentSpecToProtobuf(xpExperiment schema.Experiment, segmentersType map[string]schema.SegmenterType) (*_pubsub.Experiment, error)
- func OpenAPIProjectSettingsSpecToProtobuf(projectSettings schema.ProjectSettings) *_pubsub.ProjectSettings
- func ProtobufExperimentTypeToOpenAPI(experimentType _pubsub.Experiment_Type) schema.ExperimentType
- type ExperimentIndex
- type ExperimentIndexLog
- type ExperimentMatch
- type ExperimentStorage
- type ExperimentTreatment
- type IntSet
- type LocalStorage
- func (s *LocalStorage) DeleteProjectSegmenters(segmenterName string, projectId int64)
- func (s *LocalStorage) DumpExperiments(filepath string) error
- func (s *LocalStorage) FindExperimentWithId(projectId ProjectId, experimentId int64) *pubsub.Experiment
- func (s *LocalStorage) FindExperiments(projectId ProjectId, filters []SegmentFilter) []*ExperimentMatch
- func (s *LocalStorage) FindProjectSettingsWithId(projectId ProjectId) *pubsub.ProjectSettings
- func (s *LocalStorage) GetSegmentersTypeMapping(projectId ProjectId) (map[string]schema.SegmenterType, error)
- func (s *LocalStorage) InsertExperiment(experiment *pubsub.Experiment)
- func (s *LocalStorage) InsertProjectSettings(projectSettings *pubsub.ProjectSettings) error
- func (s *LocalStorage) UpdateExperiment(experiment *pubsub.Experiment)
- func (s *LocalStorage) UpdateProjectSegmenters(segmenter *_segmenters.SegmenterConfiguration, projectId int64)
- func (s *LocalStorage) UpdateProjectSettings(updatedProjectSettings *pubsub.ProjectSettings)
- type Match
- type MatchStrength
- type ProjectId
- type ProjectSettingsStorage
- type RealSet
- type SegmentFilter
- type StringSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsProjectId ¶
func DecodeTreatmentConfig ¶
func ExperimentTreatmentToOpenAPITreatment ¶
func ExperimentTreatmentToOpenAPITreatment(treatment *_pubsub.ExperimentTreatment) schema.SelectedTreatmentData
func OpenAPIExperimentSpecToProtobuf ¶
func OpenAPIExperimentSpecToProtobuf( xpExperiment schema.Experiment, segmentersType map[string]schema.SegmenterType, ) (*_pubsub.Experiment, error)
func OpenAPIProjectSettingsSpecToProtobuf ¶
func OpenAPIProjectSettingsSpecToProtobuf(projectSettings schema.ProjectSettings) *_pubsub.ProjectSettings
func ProtobufExperimentTypeToOpenAPI ¶
func ProtobufExperimentTypeToOpenAPI(experimentType _pubsub.Experiment_Type) schema.ExperimentType
Types ¶
type ExperimentIndex ¶
type ExperimentIndex struct { StartTime time.Time EndTime time.Time Experiment *pubsub.Experiment // contains filtered or unexported fields }
func NewExperimentIndex ¶
func NewExperimentIndex(experiment *pubsub.Experiment) *ExperimentIndex
func (*ExperimentIndex) MarshalJSON ¶
func (i *ExperimentIndex) MarshalJSON() ([]byte, error)
MarshalJSON is a custom marshal function that only includes the critical info
type ExperimentIndexLog ¶
type ExperimentIndexLog struct { StringSets map[string][]interface{} IntSets map[string][]interface{} RealSets map[string][]interface{} StartTime time.Time EndTime time.Time ExperimentId int64 Status string Tier string }
ExperimentIndexLog captures the critical information from the ExperimentIndex, in a concise manner, for logging.
type ExperimentMatch ¶
type ExperimentMatch struct { Experiment *pubsub.Experiment SegmenterMatches map[string]Match }
type ExperimentStorage ¶
type ExperimentStorage interface { FindExperiments(projectId ProjectId, filters []SegmentFilter) []*ExperimentMatch FindExperimentWithId(projectId ProjectId, experimentId int64) *pubsub.Experiment InsertExperiment(experiment *pubsub.Experiment) DeactivateExperiment(projectId ProjectId, experimentId int64) error // DumpExperiments is a helper method for a Debug API DumpExperiments(filepath string) error }
type ExperimentTreatment ¶
type LocalStorage ¶
type LocalStorage struct { sync.RWMutex Experiments map[ProjectId][]*ExperimentIndex ProjectSettings []*pubsub.ProjectSettings Segmenters map[string]schema.SegmenterType ProjectSegmenters map[ProjectId]map[string]schema.SegmenterType // contains filtered or unexported fields }
func NewLocalStorage ¶
func (*LocalStorage) DeleteProjectSegmenters ¶
func (s *LocalStorage) DeleteProjectSegmenters(segmenterName string, projectId int64)
func (*LocalStorage) DumpExperiments ¶
func (s *LocalStorage) DumpExperiments(filepath string) error
DumpExperiments is used to dump the experiment from the local cache into the given file, as JSON. Useful for debugging.
func (*LocalStorage) FindExperimentWithId ¶
func (s *LocalStorage) FindExperimentWithId(projectId ProjectId, experimentId int64) *pubsub.Experiment
func (*LocalStorage) FindExperiments ¶
func (s *LocalStorage) FindExperiments(projectId ProjectId, filters []SegmentFilter) []*ExperimentMatch
func (*LocalStorage) FindProjectSettingsWithId ¶
func (s *LocalStorage) FindProjectSettingsWithId(projectId ProjectId) *pubsub.ProjectSettings
func (*LocalStorage) GetSegmentersTypeMapping ¶
func (s *LocalStorage) GetSegmentersTypeMapping(projectId ProjectId) (map[string]schema.SegmenterType, error)
func (*LocalStorage) InsertExperiment ¶
func (s *LocalStorage) InsertExperiment(experiment *pubsub.Experiment)
func (*LocalStorage) InsertProjectSettings ¶
func (s *LocalStorage) InsertProjectSettings(projectSettings *pubsub.ProjectSettings) error
func (*LocalStorage) UpdateExperiment ¶
func (s *LocalStorage) UpdateExperiment(experiment *pubsub.Experiment)
func (*LocalStorage) UpdateProjectSegmenters ¶
func (s *LocalStorage) UpdateProjectSegmenters(segmenter *_segmenters.SegmenterConfiguration, projectId int64)
func (*LocalStorage) UpdateProjectSettings ¶
func (s *LocalStorage) UpdateProjectSettings(updatedProjectSettings *pubsub.ProjectSettings)
type Match ¶
type Match struct { Strength MatchStrength Value *_segmenters.SegmenterValue }
type MatchStrength ¶
type MatchStrength string
const ( MatchStrengthExact MatchStrength = "exact" MatchStrengthWeak MatchStrength = "weak" MatchStrengthNone MatchStrength = "none" )
type ProjectSettingsStorage ¶
type ProjectSettingsStorage interface {
FindProjectSettingsWithId(projectId ProjectId) *pubsub.ProjectSettings
}
type SegmentFilter ¶
type SegmentFilter struct { Key string Value []*_segmenters.SegmenterValue }
Click to show internal directories.
Click to hide internal directories.