Documentation ¶
Index ¶
- Constants
- func New(_ *any.Any, logger *zap.Logger, scope tally.Scope) (service.Service, error)
- func NewRunDetails(run *ExperimentRun, config *ExperimentConfig, transformer *Transformer, ...) (*experimentation.ExperimentRunDetails, error)
- func NewRunListView(run *ExperimentRun, config *ExperimentConfig, transformer *Transformer, ...) (*experimentation.ListViewItem, error)
- func StatusToString(status experimentation.Experiment_Status) string
- func TimeToPropertyDateValue(t *time.Time) (*experimentation.Property_DateValue, error)
- type CreateOrGetExperimentResult
- type Experiment
- type ExperimentConfig
- type ExperimentRun
- type ExperimentSpecification
- type Storer
- type Transformation
- type Transformer
Constants ¶
View Source
const Name = "clutch.service.chaos.experimentation.store"
Variables ¶
This section is empty.
Functions ¶
func NewRunDetails ¶
func NewRunDetails(run *ExperimentRun, config *ExperimentConfig, transformer *Transformer, now time.Time) (*experimentation.ExperimentRunDetails, error)
func NewRunListView ¶
func NewRunListView(run *ExperimentRun, config *ExperimentConfig, transformer *Transformer, now time.Time) (*experimentation.ListViewItem, error)
func StatusToString ¶
func StatusToString(status experimentation.Experiment_Status) string
func TimeToPropertyDateValue ¶
func TimeToPropertyDateValue(t *time.Time) (*experimentation.Property_DateValue, error)
Types ¶
type CreateOrGetExperimentResult ¶
type CreateOrGetExperimentResult struct { Experiment *Experiment Origin experimentationv1.CreateOrGetExperimentResponse_Origin }
type Experiment ¶
type Experiment struct { Run *ExperimentRun Config *ExperimentConfig }
func (Experiment) Proto ¶
func (rc Experiment) Proto(now time.Time) (*experimentationv1.Experiment, error)
type ExperimentConfig ¶
type ExperimentConfig struct { Id string // TODO(Augustyniak): Remove Config property once all of its existing usages are removed. Use Message property instead. Config *any.Any Message proto.Message }
func NewExperimentConfig ¶
func NewExperimentConfig(id string, stringifedData string) (*ExperimentConfig, error)
func (*ExperimentConfig) CreateProperties ¶
func (ec *ExperimentConfig) CreateProperties() ([]*experimentationv1.Property, error)
type ExperimentRun ¶
type ExperimentRun struct { Id string StartTime time.Time EndTime *time.Time CancellationTime *time.Time CreationTime time.Time TerminationReason string }
func (*ExperimentRun) CreateProperties ¶
func (er *ExperimentRun) CreateProperties(now time.Time) ([]*experimentationv1.Property, error)
func (*ExperimentRun) Status ¶
func (er *ExperimentRun) Status(now time.Time) experimentationv1.Experiment_Status
type ExperimentSpecification ¶
type ExperimentSpecification struct { RunId string ConfigId string StartTime time.Time EndTime *time.Time Config *any.Any }
func NewExperimentSpecification ¶
func NewExperimentSpecification(ced *experimentationv1.CreateExperimentData, now time.Time) (*ExperimentSpecification, error)
New returns a new experimentationSpecification instance.
type Storer ¶
type Storer interface { CreateExperiment(context.Context, *ExperimentSpecification) (*Experiment, error) CreateOrGetExperiment(context.Context, *ExperimentSpecification) (*CreateOrGetExperimentResult, error) CancelExperimentRun(ctx context.Context, id string, reason string) error GetExperiments(ctx context.Context, configType string, status experimentation.GetExperimentsRequest_Status) ([]*Experiment, error) GetExperimentRunDetails(ctx context.Context, id string) (*experimentation.ExperimentRunDetails, error) GetListView(ctx context.Context) ([]*experimentation.ListViewItem, error) RegisterTransformation(transformation Transformation) error Close() }
Storer stores experiment data
type Transformation ¶
type Transformation struct { ConfigTypeUrl string ConfigTransform func(config *ExperimentConfig) ([]*experimentation.Property, error) RunTransform func(run *ExperimentRun, config *ExperimentConfig) ([]*experimentation.Property, error) }
type Transformer ¶
type Transformer struct {
// contains filtered or unexported fields
}
func NewTransformer ¶
func NewTransformer(logger *zap.SugaredLogger) Transformer
func (*Transformer) CreateProperties ¶
func (tr *Transformer) CreateProperties(run *ExperimentRun, config *ExperimentConfig) ([]*experimentation.Property, error)
func (*Transformer) Register ¶
func (tr *Transformer) Register(transformation Transformation) error
Click to show internal directories.
Click to hide internal directories.