Versions in this module Expand all Collapse all v0 v0.0.1 Nov 26, 2024 Changes in this version + var Logger zerolog.Logger + func ChaosObjectExists(object client.Object, c client.Client) (bool, error) + func CreateLogger(config LoggerConfig) zerolog.Logger + func NewChaosMeshClient() (client.Client, error) + func Ptr[T any](value T) *T + func WaitForAllChaosRunning(chaosObjects []*Chaos, timeoutDuration time.Duration) error + type Chaos struct + Client client.Client + DelayCreate time.Duration + Description string + Object client.Object + Status ChaosStatus + func NewChaos(opts ChaosOpts) (*Chaos, error) + func (c *Chaos) AddListener(listener ChaosListener) + func (c *Chaos) Create(ctx context.Context) + func (c *Chaos) Delete(ctx context.Context) error + func (c *Chaos) GetChaosDescription() string + func (c *Chaos) GetChaosDuration() (time.Duration, error) + func (c *Chaos) GetChaosEvents() (*corev1.EventList, error) + func (c *Chaos) GetChaosKind() string + func (c *Chaos) GetChaosName() string + func (c *Chaos) GetChaosSpec() interface{} + func (c *Chaos) GetChaosStatus() (*v1alpha1.ChaosStatus, error) + func (c *Chaos) GetChaosTypeStr() string + func (c *Chaos) GetEndTime() time.Time + func (c *Chaos) GetExpectedEndTime() (time.Time, error) + func (c *Chaos) GetExperimentStatus() (v1alpha1.ExperimentStatus, error) + func (c *Chaos) GetObject() client.Object + func (c *Chaos) GetStartTime() time.Time + func (c *Chaos) Pause(ctx context.Context) error + func (c *Chaos) Resume(ctx context.Context) error + func (c *Chaos) Update(ctx context.Context) error + type ChaosEntity interface + AddListener func(listener ChaosListener) + Create func(ctx context.Context) + Delete func(ctx context.Context) error + GetChaosDescription func() string + GetChaosDuration func() (time.Duration, error) + GetChaosName func() string + GetChaosSpec func() interface{} + GetEndTime func() time.Time + GetExpectedEndTime func() (time.Time, error) + GetObject func() client.Object + GetStartTime func() time.Time + type ChaosEventDetails struct + Chaos *Chaos + Error error + Event string + type ChaosListener interface + OnChaosCreated func(chaos Chaos) + OnChaosCreationFailed func(chaos Chaos, reason error) + OnChaosEnded func(chaos Chaos) + OnChaosPaused func(chaos Chaos) + OnChaosStarted func(chaos Chaos) + OnChaosStatusUnknown func(chaos Chaos) + OnScheduleCreated func(chaos Schedule) + OnScheduleDeleted func(chaos Schedule) + type ChaosLogger struct + func NewChaosLogger(logger zerolog.Logger) *ChaosLogger + func (l ChaosLogger) OnChaosCreated(chaos Chaos) + func (l ChaosLogger) OnChaosCreationFailed(chaos Chaos, reason error) + func (l ChaosLogger) OnChaosDeleted(chaos Chaos) + func (l ChaosLogger) OnChaosEnded(chaos Chaos) + func (l ChaosLogger) OnChaosPaused(chaos Chaos) + func (l ChaosLogger) OnChaosStarted(chaos Chaos) + func (l ChaosLogger) OnChaosStatusUnknown(chaos Chaos) + func (l ChaosLogger) OnScheduleCreated(schedule Schedule) + func (l ChaosLogger) OnScheduleDeleted(schedule Schedule) + type ChaosOpts struct + Client client.Client + DelayCreate time.Duration + Description string + Listeners []ChaosListener + Logger *zerolog.Logger + Object client.Object + type ChaosStatus string + const StatusCreated + const StatusCreationFailed + const StatusDeleted + const StatusFinished + const StatusPaused + const StatusRunning + const StatusUnknown + type LoggerConfig struct + LogLevel string + LogOutput string + LogType string + type NetworkChaosOpts struct + Delay *v1alpha1.DelaySpec + DelayCreate time.Duration + Description string + Duration time.Duration + K8sClient client.Client + Loss *v1alpha1.LossSpec + Name string + NodeCount int + Selector v1alpha1.PodSelectorSpec + func (o *NetworkChaosOpts) Validate() error + type PodChaosOpts struct + DelayCreate time.Duration + Description string + Duration time.Duration + K8sClient client.Client + Name string + NodeCount int + Spec v1alpha1.PodChaosSpec + type RangeGrafanaAnnotator struct + func NewRangeGrafanaAnnotator(grafanaURL, grafanaToken, dashboardUID string, logger zerolog.Logger) *RangeGrafanaAnnotator + func (l RangeGrafanaAnnotator) OnChaosCreated(chaos Chaos) + func (l RangeGrafanaAnnotator) OnChaosEnded(chaos Chaos) + func (l RangeGrafanaAnnotator) OnChaosPaused(chaos Chaos) + func (l RangeGrafanaAnnotator) OnChaosStarted(chaos Chaos) + func (l RangeGrafanaAnnotator) OnChaosStatusUnknown(chaos Chaos) + func (l RangeGrafanaAnnotator) OnScheduleCreated(chaos Schedule) + func (l RangeGrafanaAnnotator) OnScheduleDeleted(chaos Schedule) + type Schedule struct + Client client.Client + DelayCreate time.Duration + Description string + Duration time.Duration + Object *v1alpha1.Schedule + Status ChaosStatus + func NewSchedule(opts ScheduleOpts) (*Schedule, error) + func (s *Schedule) AddListener(listener ChaosListener) + func (s *Schedule) Create(ctx context.Context) + func (s *Schedule) Delete(ctx context.Context) error + func (s *Schedule) GetChaosDescription() string + func (s *Schedule) GetChaosDuration() (time.Duration, error) + func (s *Schedule) GetChaosName() string + func (s *Schedule) GetChaosSpec() interface{} + func (s *Schedule) GetEndTime() time.Time + func (s *Schedule) GetExpectedEndTime() (time.Time, error) + func (s *Schedule) GetObject() client.Object + func (s *Schedule) GetStartTime() time.Time + type ScheduleOpts struct + Client client.Client + DelayCreate time.Duration + Description string + Duration time.Duration + Listeners []ChaosListener + Logger *zerolog.Logger + Object *v1alpha1.Schedule + type ScheduleStatus string + const ScheduleStatusCreated + const ScheduleStatusDeleted + const ScheduleStatusUnknown + type SimplifiedEvent struct + LastTimestamp string + Message string + Type string + type SingleLineGrafanaAnnotator struct + func NewSingleLineGrafanaAnnotator(grafanaURL, grafanaToken, dashboardUID string, logger zerolog.Logger) *SingleLineGrafanaAnnotator + func (l SingleLineGrafanaAnnotator) OnChaosCreated(chaos Chaos) + func (l SingleLineGrafanaAnnotator) OnChaosCreationFailed(chaos Chaos, reason error) + func (l SingleLineGrafanaAnnotator) OnChaosEnded(chaos Chaos) + func (l SingleLineGrafanaAnnotator) OnChaosPaused(chaos Chaos) + func (l SingleLineGrafanaAnnotator) OnChaosStarted(chaos Chaos) + func (l SingleLineGrafanaAnnotator) OnChaosStatusUnknown(chaos Chaos) + func (l SingleLineGrafanaAnnotator) OnScheduleCreated(s Schedule) + func (l SingleLineGrafanaAnnotator) OnScheduleDeleted(s Schedule) + type StressChaosOpts struct + DelayCreate time.Duration + Description string + Duration time.Duration + K8sClient client.Client + Name string + NodeCount int + Selector v1alpha1.PodSelectorSpec + Stressors *v1alpha1.Stressors