service

package
v0.0.0-...-6cc63a5 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertExperimentVariablesType

func ConvertExperimentVariablesType(parameters schema.ProjectSegmenters_Variables) []string

Types

type InMemoryStore

type InMemoryStore struct {
	sync.RWMutex
	Experiments     []schema.Experiment
	ProjectSettings []schema.ProjectSettings
	MessageQueue    MessageQueue
	SegmentersTypes map[string]schema.SegmenterType
}

func NewInMemoryStore

func NewInMemoryStore(
	experiments []schema.Experiment,
	settings []schema.ProjectSettings,
	queue MessageQueue,
	segmentersType map[string]schema.SegmenterType,
) (*InMemoryStore, error)

func (*InMemoryStore) CreateExperiment

func (i *InMemoryStore) CreateExperiment(experiment schema.Experiment) (schema.Experiment, error)

func (*InMemoryStore) GetExperiment

func (i *InMemoryStore) GetExperiment(projectId int64, experimentId int64) (schema.Experiment, error)

func (*InMemoryStore) GetProjectExperimentVariables

func (i *InMemoryStore) GetProjectExperimentVariables(projectId int64) ([]string, error)

func (*InMemoryStore) GetProjectSettings

func (i *InMemoryStore) GetProjectSettings(projectId int64) (schema.ProjectSettings, error)

func (*InMemoryStore) ListExperiments

func (i *InMemoryStore) ListExperiments(projectId int64, params api.ListExperimentsParams) ([]schema.Experiment, error)

func (*InMemoryStore) ListProjects

func (i *InMemoryStore) ListProjects() ([]schema.Project, error)

func (*InMemoryStore) ListSegmenters

func (i *InMemoryStore) ListSegmenters(projectId int64) ([]schema.Segmenter, error)

func (*InMemoryStore) UpdateExperiment

func (i *InMemoryStore) UpdateExperiment(projectId int64, experimentId int64, experiment schema.Experiment) (schema.Experiment, error)

func (*InMemoryStore) UpdateProjectSettings

func (i *InMemoryStore) UpdateProjectSettings(updated schema.ProjectSettings) error

type InvalidExperiment

type InvalidExperiment struct {
	// contains filtered or unexported fields
}

func (InvalidExperiment) Error

func (i InvalidExperiment) Error() string

type InvalidProjectSettings

type InvalidProjectSettings struct {
	// contains filtered or unexported fields
}

func (InvalidProjectSettings) Error

func (i InvalidProjectSettings) Error() string

type InvalidTreatment

type InvalidTreatment struct {
	// contains filtered or unexported fields
}

func (InvalidTreatment) Error

func (i InvalidTreatment) Error() string

type MessageQueue

type MessageQueue interface {
	PublishNewExperiment(experiment schema.Experiment, segmentersType map[string]schema.SegmenterType) error
	UpdateExperiment(experiment schema.Experiment, segmentersType map[string]schema.SegmenterType) error
	UpdateProjectSettings(settings schema.ProjectSettings) error
}

type PubSubConfig

type PubSubConfig struct {
	GCPProject string
	TopicName  string
}

type PubSubMessageQueue

type PubSubMessageQueue struct {
	// contains filtered or unexported fields
}

func NewPubSubMessageQueue

func NewPubSubMessageQueue(config PubSubConfig) (*PubSubMessageQueue, error)

func (*PubSubMessageQueue) PublishNewExperiment

func (i *PubSubMessageQueue) PublishNewExperiment(
	experiment schema.Experiment,
	segmentersType map[string]schema.SegmenterType,
) error

func (*PubSubMessageQueue) UpdateExperiment

func (i *PubSubMessageQueue) UpdateExperiment(
	experiment schema.Experiment,
	segmentersType map[string]schema.SegmenterType,
) error

func (*PubSubMessageQueue) UpdateProjectSettings

func (i *PubSubMessageQueue) UpdateProjectSettings(settings schema.ProjectSettings) error

Jump to

Keyboard shortcuts

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