domain

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExperimentBeforeStart       = errors.New("experiment: start timestamp is greater than now")
	ErrExperimentBeforeStop        = errors.New("experiment: stop timestamp is greater than now")
	ErrExperimentStatusInvalid     = errors.New("experiment: experiment status is invalid")
	ErrExperimentAlreadyStopped    = errors.New("experiment: experiment is already stopped")
	ErrExperimentStartIsAfterStop  = errors.New("experiment: start is after stop timestamp")
	ErrExperimentStopIsBeforeStart = errors.New("experiment: stop is before start timestamp")
	ErrExperimentStopIsBeforeNow   = errors.New("experiment: stop is same or older than now timestamp")
)

Functions

func SyncGoalIDs

func SyncGoalIDs(goalID string, goalIDs []string) (string, []string)

SyncGoalIDs syncs goalID and goalIDs. FIXME: This function is needed until admin UI implements multiple goals.

Types

type Experiment

type Experiment struct {
	*experimentproto.Experiment
}

func NewExperiment

func NewExperiment(
	featureID string,
	featureVersion int32,
	variations []*featureproto.Variation,
	goalIDs []string,
	startAt int64,
	stopAt int64,
	name string,
	description string,
	baseVariationID string,
	maintainer string) (*Experiment, error)

func (*Experiment) ChangeDescription

func (e *Experiment) ChangeDescription(description string) error

func (*Experiment) ChangeName

func (e *Experiment) ChangeName(name string) error

func (*Experiment) ChangePeriod

func (e *Experiment) ChangePeriod(startAt, stopAt int64) error

func (*Experiment) ChangeStartAt

func (e *Experiment) ChangeStartAt(startAt int64) error

func (*Experiment) ChangeStopAt

func (e *Experiment) ChangeStopAt(stopAt int64) error

func (*Experiment) Finish

func (e *Experiment) Finish() error

func (*Experiment) IsNotFinished

func (e *Experiment) IsNotFinished(t time.Time) bool

IsNotFinished returns true if the status is either waiting or running.

func (*Experiment) SetArchived

func (e *Experiment) SetArchived() error

func (*Experiment) SetDeleted

func (e *Experiment) SetDeleted() error

func (*Experiment) Start

func (e *Experiment) Start() error

func (*Experiment) Stop

func (e *Experiment) Stop() error

type Goal

type Goal struct {
	*proto.Goal
}

func NewGoal

func NewGoal(id, name, description string) (*Goal, error)

func (*Goal) ChangeDescription

func (g *Goal) ChangeDescription(description string) error

func (*Goal) Rename

func (g *Goal) Rename(name string) error

func (*Goal) SetArchived

func (g *Goal) SetArchived() error

func (*Goal) SetDeleted

func (g *Goal) SetDeleted() error

Jump to

Keyboard shortcuts

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