data

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExperimentModel

type ExperimentModel struct {
	Uid        string
	Command    string
	SubCommand string
	Flag       string
	Status     string
	Error      string
	CreateTime string
	UpdateTime string
}

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)

	// ListExperimentModels
	ListExperimentModels() ([]*ExperimentModel, error)

	// QueryExperimentModelsByCommand
	QueryExperimentModelsByCommand(target string) ([]*ExperimentModel, error)
}

type PreparationRecord

type PreparationRecord struct {
	Uid         string
	ProgramType string
	Process     string
	Port        string
	Status      string
	Error       string
	CreateTime  string
	UpdateTime  string
}

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, process string) (*PreparationRecord, error)

	// ListPreparationRecords
	ListPreparationRecords() ([]*PreparationRecord, error)

	// UpdatePreparationRecordByUid
	UpdatePreparationRecordByUid(uid, status, errMsg string) error
}

type Source

type Source struct {
	DB *sql.DB
}

func (*Source) CheckAndInitExperimentTable

func (s *Source) CheckAndInitExperimentTable()

func (*Source) CheckAndInitPreTable

func (s *Source) CheckAndInitPreTable()

func (*Source) Close

func (s *Source) Close()

func (*Source) ExperimentTableExists

func (s *Source) ExperimentTableExists() (bool, error)

func (*Source) InitExperimentTable

func (s *Source) InitExperimentTable() error

func (*Source) InitPreparationTable

func (s *Source) InitPreparationTable() error

func (*Source) InsertExperimentModel

func (s *Source) InsertExperimentModel(model *ExperimentModel) error

func (*Source) InsertPreparationRecord

func (s *Source) InsertPreparationRecord(record *PreparationRecord) error

func (*Source) ListExperimentModels

func (s *Source) ListExperimentModels() ([]*ExperimentModel, error)

func (*Source) ListPreparationRecords

func (s *Source) ListPreparationRecords() ([]*PreparationRecord, error)

func (*Source) PreparationTableExists

func (s *Source) PreparationTableExists() (bool, error)

func (*Source) QueryExperimentModelByUid

func (s *Source) QueryExperimentModelByUid(uid string) (*ExperimentModel, error)

func (*Source) QueryExperimentModelsByCommand

func (s *Source) QueryExperimentModelsByCommand(target string) ([]*ExperimentModel, error)

func (*Source) QueryPreparationByUid

func (s *Source) QueryPreparationByUid(uid string) (*PreparationRecord, error)

func (*Source) QueryRunningPreByTypeAndProcess

func (s *Source) QueryRunningPreByTypeAndProcess(programType string, process string) (*PreparationRecord, error)

func (*Source) UpdateExperimentModelByUid

func (s *Source) UpdateExperimentModelByUid(uid, status, errMsg string) error

func (*Source) UpdatePreparationRecordByUid

func (s *Source) UpdatePreparationRecordByUid(uid, status, errMsg string) error

type SourceI

type SourceI interface {
	ExperimentSource
	PreparationSource
}

func GetSource

func GetSource() SourceI

Jump to

Keyboard shortcuts

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