core

package
v0.27.2 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCompareSpec added in v0.27.2

func BuildCompareSpec(targets []string, baseline string) *restfile.CompareSpec

func CloneCompareSpec added in v0.27.2

func CloneCompareSpec(spec *restfile.CompareSpec) *restfile.CompareSpec

func CompareBaseIndex

func CompareBaseIndex(rows []engine.CompareRow, want string) int

func CompareBaseline

func CompareBaseline(rows []engine.CompareRow, want string) string

func Emit

func Emit(ctx context.Context, s Sink, e Evt) error

func EmitAll

func EmitAll(ctx context.Context, s Sink, es ...Evt) error

func RunCompare

func RunCompare(ctx context.Context, dep Dep, sink Sink, pl *ComparePlan) error

func RunPlan

func RunPlan(ctx context.Context, dep Dep, sink Sink, pl *WorkflowPlan) error

func RunProfile

func RunProfile(ctx context.Context, dep Dep, sink Sink, pl *ProfilePlan) error

Types

type CmpRowDone

type CmpRowDone struct {
	Meta   EvtMeta
	Row    RowMeta
	Result engine.RequestResult
}

type CmpRowStart

type CmpRowStart struct {
	Meta    EvtMeta
	Row     RowMeta
	Doc     *restfile.Document
	Request *restfile.Request
}

type ComparePlan

type ComparePlan struct {
	Run     RunMeta
	Doc     *restfile.Document
	Request *restfile.Request
	Spec    restfile.CompareSpec
}

func PrepareCompare

func PrepareCompare(
	doc *restfile.Document,
	req *restfile.Request,
	spec *restfile.CompareSpec,
	run RunMeta,
) (*ComparePlan, error)

type Evt

type Evt interface {
	// contains filtered or unexported methods
}

type EvtMeta

type EvtMeta struct {
	Run RunMeta
	At  time.Time
}

func MetaOf

func MetaOf(e Evt) EvtMeta

func NewMeta

func NewMeta(run RunMeta, at time.Time) EvtMeta

type IterMeta

type IterMeta struct {
	Index       int
	Total       int
	Warmup      bool
	WarmupIndex int
	WarmupTotal int
	RunIndex    int
	RunTotal    int
	Delay       time.Duration
}

type Mode

type Mode uint8
const (
	ModeUnknown Mode = iota
	ModeWorkflow
	ModeForEach
	ModeCompare
	ModeProfile
)

func (Mode) String

func (m Mode) String() string

type NopSink

type NopSink struct{}

func (NopSink) OnEvt

func (NopSink) OnEvt(context.Context, Evt) error

type ProIterDone

type ProIterDone struct {
	Meta   EvtMeta
	Iter   IterMeta
	Result engine.RequestResult
}

type ProIterStart

type ProIterStart struct {
	Meta    EvtMeta
	Iter    IterMeta
	Doc     *restfile.Document
	Request *restfile.Request
}

type ProfilePlan

type ProfilePlan struct {
	Run     RunMeta
	Doc     *restfile.Document
	Request *restfile.Request
	Spec    restfile.ProfileSpec
	Total   int
}

func PrepareProfile

func PrepareProfile(
	doc *restfile.Document,
	req *restfile.Request,
	run RunMeta,
) (*ProfilePlan, error)

type ReqDone

type ReqDone struct {
	Meta   EvtMeta
	Req    ReqMeta
	Result engine.RequestResult
}

type ReqMeta

type ReqMeta struct {
	Index int
	Label string
	Env   string
}

type ReqStart

type ReqStart struct {
	Meta    EvtMeta
	Req     ReqMeta
	Doc     *restfile.Document
	Request *restfile.Request
}

type RowMeta

type RowMeta struct {
	Index int
	Env   string
	Base  bool
	Total int
}

type RunDone

type RunDone struct {
	Meta     EvtMeta
	Success  bool
	Skipped  bool
	Canceled bool
	Err      error
}

type RunMeta

type RunMeta struct {
	ID   string
	Mode Mode
	Name string
	Env  string
}

type RunStart

type RunStart struct {
	Meta EvtMeta
}

type Sink

type Sink interface {
	OnEvt(context.Context, Evt) error
}
var Discard Sink = NopSink{}

type SinkFunc

type SinkFunc func(context.Context, Evt) error

func (SinkFunc) OnEvt

func (fn SinkFunc) OnEvt(ctx context.Context, e Evt) error

type StepMeta

type StepMeta struct {
	Index  int
	Name   string
	Kind   restfile.WorkflowStepKind
	Target string
	Branch string
	Iter   int
	Total  int
}

type WfStepDone

type WfStepDone struct {
	Meta   EvtMeta
	Step   StepMeta
	Result engine.RequestResult
}

type WfStepStart

type WfStepStart struct {
	Meta    EvtMeta
	Step    StepMeta
	Doc     *restfile.Document
	Request *restfile.Request
}

type WorkflowPlan

type WorkflowPlan struct {
	Run      RunMeta
	Doc      *restfile.Document
	Workflow restfile.Workflow
	Steps    []WorkflowStepRuntime
	Reqs     map[string]*restfile.Request
	Vars     map[string]string
	WfVars   bool
}

func PrepareForEach

func PrepareForEach(
	doc *restfile.Document,
	req *restfile.Request,
	run RunMeta,
) (*WorkflowPlan, error)

func PrepareWorkflow

func PrepareWorkflow(
	doc *restfile.Document,
	wf restfile.Workflow,
	run RunMeta,
) (*WorkflowPlan, error)

type WorkflowStepRuntime

type WorkflowStepRuntime struct {
	Step restfile.WorkflowStep
	Req  *restfile.Request
}

Jump to

Keyboard shortcuts

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