core

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InitEngineServices = func(h types.Hammer) (*EngineServices, error) {

	as := assertion.NewDefaultAssertionService()
	as.Init(h.Assertions)

	ps, err := proxy.NewProxyService(h.Proxy.Strategy)
	if err != nil {
		return nil, err
	}
	err = ps.Init(h.Proxy)
	if err != nil {
		return nil, err
	}

	rs, err := report.NewReportService(h.ReportDestination)
	if err != nil {
		return nil, err
	}
	if err = rs.Init(h.Debug, h.SamplingRate); err != nil {
		return nil, err
	}

	return &EngineServices{

		Aborter:     as,
		Asserter:    as,
		ResListener: as,

		ProxyServ:  ps,
		ReportServ: rs,
	}, nil
}

Functions

func NewEngine

func NewEngine(ctx context.Context, h types.Hammer,
	services *EngineServices) (e *engine, err error)

NewEngine is the constructor of the engine. Hammer is used for initializing the engine itself and its' external services. Engine can be stopped by canceling the given ctx.

Types

type EngineServices added in v1.0.0

type EngineServices struct {
	Aborter     assertion.Aborter
	Asserter    assertion.Asserter
	ResListener assertion.ResultListener

	ProxyServ  proxy.ProxyService
	ReportServ report.ReportService
}

Jump to

Keyboard shortcuts

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