mockoutput

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2023 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockOutput

type MockOutput struct {
	SampleContainers []workerMetrics.SampleContainer
	Samples          []workerMetrics.Sample
	RunStatus        libWorker.RunStatus

	DescFn  func() string
	StartFn func() error
	StopFn  func() error
}

MockOutput can be used in tests to mock an actual output.

func New

func New() *MockOutput

New exists so that the usage from tests avoids repetition, i.e. is mockoutput.New() instead of &mockoutput.MockOutput{}

func (*MockOutput) AddMetricSamples

func (mo *MockOutput) AddMetricSamples(scs []workerMetrics.SampleContainer)

AddMetricSamples just saves the results in memory.

func (*MockOutput) Description

func (mo *MockOutput) Description() string

Description calls the supplied DescFn callback, if available.

func (*MockOutput) SetRunStatus

func (mo *MockOutput) SetRunStatus(latestStatus libWorker.RunStatus)

SetRunStatus updates the RunStatus property.

func (*MockOutput) Start

func (mo *MockOutput) Start() error

Start calls the supplied StartFn callback, if available.

func (*MockOutput) Stop

func (mo *MockOutput) Stop() error

Stop calls the supplied StopFn callback, if available.

Jump to

Keyboard shortcuts

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