worker_mocks

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2022 License: Apache-2.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockWorker

type MockWorker struct {
	ReceivedEvents   []*triggers2.Event
	ReceivedRequests []*triggers2.HttpRequest
	// contains filtered or unexported fields
}

MockWorker - A mock worker interface for testing

func NewMockWorker

func NewMockWorker(opts *MockWorkerOptions) *MockWorker

func (*MockWorker) HandleEvent

func (m *MockWorker) HandleEvent(ctx context.Context, trigger *triggers2.Event) error

func (*MockWorker) HandleHttpRequest

func (m *MockWorker) HandleHttpRequest(ctx context.Context, trigger *triggers2.HttpRequest) (*triggers2.HttpResponse, error)

func (*MockWorker) HandlesEvent added in v0.13.0

func (m *MockWorker) HandlesEvent(trigger *triggers2.Event) bool

func (*MockWorker) HandlesHttpRequest added in v0.13.0

func (m *MockWorker) HandlesHttpRequest(trigger *triggers2.HttpRequest) bool

func (*MockWorker) Reset

func (m *MockWorker) Reset()

type MockWorkerOptions

type MockWorkerOptions struct {
	ReturnHttp *triggers2.HttpResponse
	HttpError  error
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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