Documentation ¶
Index ¶
- func Migrate(mysqlDb MySQL) error
- func TxDeadlock(err error) bool
- func ViolatesMinTime(err error) bool
- type MySQL
- func (m MySQL) Check(term chaosmonkey.Termination, appCfg chaosmonkey.AppConfig, endHour int, ...) error
- func (m MySQL) CheckWithDelay(term chaosmonkey.Termination, appCfg chaosmonkey.AppConfig, endHour int, ...) error
- func (m MySQL) Close() error
- func (m MySQL) Publish(date time.Time, sched *schedule.Schedule) error
- func (m MySQL) PublishWithDelay(date time.Time, sched *schedule.Schedule, delay time.Duration) (err error)
- func (m MySQL) Retrieve(date time.Time) (sched *schedule.Schedule, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TxDeadlock ¶
TxDeadlock returns true if the error is because of a transaction deadlock
func ViolatesMinTime ¶
ViolatesMinTime returns true if the error violates min time between terminations
Types ¶
type MySQL ¶
type MySQL struct {
// contains filtered or unexported fields
}
MySQL represents a MySQL-backed store for schedules and terminations
func NewFromConfig ¶
NewFromConfig creates a new MySQL taking config parameters from cfg
func (MySQL) Check ¶
func (m MySQL) Check(term chaosmonkey.Termination, appCfg chaosmonkey.AppConfig, endHour int, loc *time.Location) error
Check checks if a termination is permitted and, if so, records the termination time on the server
func (MySQL) CheckWithDelay ¶
func (m MySQL) CheckWithDelay(term chaosmonkey.Termination, appCfg chaosmonkey.AppConfig, endHour int, loc *time.Location, delay time.Duration) error
CheckWithDelay is the same as Check, but adds a delay between reading and writing to the database (used for testing only)
Click to show internal directories.
Click to hide internal directories.