Documentation ¶
Index ¶
- Constants
- func UpperFirst(str string) string
- type ExperimentModel
- type ExperimentSource
- type PreparationRecord
- type PreparationSource
- type Source
- func (s *Source) AlterPreparationTable(alterSql string) error
- func (s *Source) CheckAndInitExperimentTable()
- func (s *Source) CheckAndInitPreTable()
- func (s *Source) Close()
- func (s *Source) DeleteExperimentModelByUid(uid string) error
- func (s *Source) ExperimentTableExists() (bool, error)
- func (s *Source) GetUserVersion() (int, error)
- func (s *Source) InitExperimentTable() error
- func (s *Source) InitPreparationTable() error
- func (s *Source) InsertExperimentModel(model *ExperimentModel) error
- func (s *Source) InsertPreparationRecord(record *PreparationRecord) error
- func (s *Source) PreparationTableExists() (bool, error)
- func (s *Source) QueryExperimentModelByUid(uid string) (*ExperimentModel, error)
- func (s *Source) QueryExperimentModels(target, action, status, limit string, asc bool) ([]*ExperimentModel, error)
- func (s *Source) QueryExperimentModelsByCommand(command, subCommand string, flags map[string]string) ([]*ExperimentModel, error)
- func (s *Source) QueryPreparationByUid(uid string) (*PreparationRecord, error)
- func (s *Source) QueryPreparationRecords(target, status, limit string, asc bool) ([]*PreparationRecord, error)
- func (s *Source) QueryRunningPreByTypeAndProcess(programType string, processName, processId string) (*PreparationRecord, error)
- func (s *Source) UpdateExperimentModelByUid(uid, status, errMsg string) error
- func (s *Source) UpdatePreparationPidByUid(uid, pid string) error
- func (s *Source) UpdatePreparationPortByUid(uid, port string) error
- func (s *Source) UpdatePreparationRecordByUid(uid, status, errMsg string) error
- func (s *Source) UpdateUserVersion(version int) error
- type SourceI
Constants ¶
View Source
const UserVersion = 1
UserVersion PRAGMA [database.]user_version
Variables ¶
This section is empty.
Functions ¶
func UpperFirst ¶ added in v0.4.0
Types ¶
type ExperimentModel ¶
type ExperimentSource ¶
type ExperimentSource interface { // CheckAndInitExperimentTable, if experiment table not exists, then init it CheckAndInitExperimentTable() // ExperimentTableExists return true if experiment exists ExperimentTableExists() (bool, error) // InitExperimentTable for first executed InitExperimentTable() error // InsertExperimentModel for creating chaos experiment InsertExperimentModel(model *ExperimentModel) error // UpdateExperimentModelByUid UpdateExperimentModelByUid(uid, status, errMsg string) error // QueryExperimentModelByUid QueryExperimentModelByUid(uid string) (*ExperimentModel, error) // QueryExperimentModels QueryExperimentModels(target, action, status, limit string, asc bool) ([]*ExperimentModel, error) // QueryExperimentModelsByCommand // flags value contains necessary parameters generally QueryExperimentModelsByCommand(command, subCommand string, flags map[string]string) ([]*ExperimentModel, error) // DeleteExperimentModelByUid DeleteExperimentModelByUid(uid string) error }
type PreparationRecord ¶
type PreparationSource ¶
type PreparationSource interface { // CheckAndInitPreTable CheckAndInitPreTable() // InitPreparationTable when first executed InitPreparationTable() error // PreparationTableExists return true if preparation exists, otherwise return false or error if execute sql exception PreparationTableExists() (bool, error) // InsertPreparationRecord InsertPreparationRecord(record *PreparationRecord) error // QueryPreparationByUid QueryPreparationByUid(uid string) (*PreparationRecord, error) // QueryRunningPreByTypeAndProcess QueryRunningPreByTypeAndProcess(programType string, processName, processId string) (*PreparationRecord, error) // UpdatePreparationRecordByUid UpdatePreparationRecordByUid(uid, status, errMsg string) error // UpdatePreparationPortByUid UpdatePreparationPortByUid(uid, port string) error // UpdatePreparationPidByUid UpdatePreparationPidByUid(uid, pid string) error // QueryPreparationRecords QueryPreparationRecords(target, status, limit string, asc bool) ([]*PreparationRecord, error) }
type Source ¶
func (*Source) AlterPreparationTable ¶ added in v0.3.0
func (*Source) CheckAndInitExperimentTable ¶
func (s *Source) CheckAndInitExperimentTable()
func (*Source) CheckAndInitPreTable ¶
func (s *Source) CheckAndInitPreTable()
func (*Source) DeleteExperimentModelByUid ¶ added in v0.6.0
func (*Source) ExperimentTableExists ¶
func (*Source) GetUserVersion ¶ added in v0.3.0
GetUserVersion returns the user_version value
func (*Source) InitExperimentTable ¶
func (*Source) InitPreparationTable ¶
func (*Source) InsertExperimentModel ¶
func (s *Source) InsertExperimentModel(model *ExperimentModel) error
func (*Source) InsertPreparationRecord ¶
func (s *Source) InsertPreparationRecord(record *PreparationRecord) error
func (*Source) PreparationTableExists ¶
func (*Source) QueryExperimentModelByUid ¶
func (s *Source) QueryExperimentModelByUid(uid string) (*ExperimentModel, error)
func (*Source) QueryExperimentModels ¶ added in v0.4.0
func (s *Source) QueryExperimentModels(target, action, status, limit string, asc bool) ([]*ExperimentModel, error)
func (*Source) QueryExperimentModelsByCommand ¶
func (*Source) QueryPreparationByUid ¶
func (s *Source) QueryPreparationByUid(uid string) (*PreparationRecord, error)
func (*Source) QueryPreparationRecords ¶ added in v0.4.0
func (s *Source) QueryPreparationRecords(target, status, limit string, asc bool) ([]*PreparationRecord, error)
func (*Source) QueryRunningPreByTypeAndProcess ¶
func (s *Source) QueryRunningPreByTypeAndProcess(programType string, processName, processId string) (*PreparationRecord, error)
QueryRunningPreByTypeAndProcess returns the first record matching the process id or process name
func (*Source) UpdateExperimentModelByUid ¶
func (*Source) UpdatePreparationPidByUid ¶ added in v0.3.0
func (*Source) UpdatePreparationPortByUid ¶ added in v0.3.0
func (*Source) UpdatePreparationRecordByUid ¶
func (*Source) UpdateUserVersion ¶ added in v0.3.0
UpdateUserVersion to the latest
type SourceI ¶
type SourceI interface { ExperimentSource PreparationSource }
Click to show internal directories.
Click to hide internal directories.