handler

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 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

type AppliedCase struct {
	Tc  pkg.TestCase
	Cfg string
}

type Processor

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

func NewProcessor

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

func (*Processor) CasesRunnerHandler

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

func (*Processor) Check

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

func (*Processor) Clean

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

func (*Processor) DisplayClusterHandler

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

func (*Processor) DisplayExpectationHandler

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

func (*Processor) DisplayStagesHandler

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

func (*Processor) DisplayTestCasesHandler

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

func (*Processor) ExpectationCheckerHandler

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

func (*Processor) HelperHandler

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

func (*Processor) ReloadClusterReg

func (s *Processor) ReloadClusterReg()

func (*Processor) Run

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

func (*Processor) RunStage

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

func (*Processor) StageRunnerHandler

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

type StageRunner

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

type Storage

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