handler

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: May 11, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Unknown    = "unknown"
	Succeed    = "succeed"
	Failed     = "failed"
	InfoLevel  = 0
	DebugLevel = 1
)
View Source
const (
	Apply  ocCommand = "apply"
	Delete ocCommand = "delete"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AppliedCase added in v0.1.0

type AppliedCase struct {
	Tc  pkg.TestCase
	Cfg string
}

type Processor added in v0.1.0

type Processor struct {
	// contains filtered or unexported fields
}

func NewProcessor added in v0.1.0

func NewProcessor(cfgDir string, timeout int, storage Storage, logger logr.Logger) (*Processor, error)

func (*Processor) CasesRunnerHandler added in v0.1.4

func (s *Processor) CasesRunnerHandler(w http.ResponseWriter, r *http.Request)

func (*Processor) Check added in v0.1.0

func (s *Processor) Check(testID string, timeout time.Duration, expReg pkg.ExpctationReg) (*TResponse, error)

func (*Processor) Clean added in v0.1.0

func (s *Processor) Clean(applied AppliedCase) error

func (*Processor) DisplayClusterHandler added in v0.1.0

func (s *Processor) DisplayClusterHandler(w http.ResponseWriter, r *http.Request)

func (*Processor) DisplayExpectationHandler added in v0.1.0

func (s *Processor) DisplayExpectationHandler(w http.ResponseWriter, r *http.Request)

func (*Processor) DisplayStagesHandler added in v0.1.0

func (s *Processor) DisplayStagesHandler(w http.ResponseWriter, r *http.Request)

func (*Processor) DisplayTestCasesHandler added in v0.1.0

func (s *Processor) DisplayTestCasesHandler(w http.ResponseWriter, r *http.Request)

func (*Processor) ExpectationCheckerHandler added in v0.1.0

func (s *Processor) ExpectationCheckerHandler(w http.ResponseWriter, r *http.Request)

func (*Processor) HelperHandler added in v0.1.0

func (s *Processor) HelperHandler(w http.ResponseWriter, r *http.Request)

func (*Processor) ReloadClusterReg added in v0.1.0

func (s *Processor) ReloadClusterReg()

func (*Processor) Run added in v0.1.0

func (s *Processor) Run(testID string, tc pkg.TestCasesReg) (AppliedCase, error)

func (*Processor) RunStage added in v0.1.0

func (st *Processor) RunStage(groupID string, timeout time.Duration, sRunner StageRunner) *TResponse

func (*Processor) StageRunnerHandler added in v0.1.0

func (s *Processor) StageRunnerHandler(w http.ResponseWriter, r *http.Request)

type StageRunner added in v0.1.0

type StageRunner interface {
	Run(id string, caseReg pkg.TestCasesReg) (AppliedCase, error)
	Check(id string, timeout time.Duration, expReg pkg.ExpctationReg) (*TResponse, error)
	Clean(AppliedCase) error
}

type Storage added in v0.2.4

type Storage interface {
	LoadTestCases() (pkg.TestCasesReg, error)
	LoadExpectations() (pkg.ExpctationReg, error)
	LoadStages() (pkg.StageReg, error)
}

type TResponse

type TResponse struct {
	TestID  string      `json:"test_id"`
	Name    string      `json:"name"`
	Status  string      `json:"run_status"`
	Error   string      `json:"error"`
	Details interface{} `json:"details"`
}

func (*TResponse) String

func (tr *TResponse) String() string

Jump to

Keyboard shortcuts

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