extensiontest

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package extensiontest define types and functions used to help test packages implementing the extension package interfaces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockHost

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

MockHost mocks an component.Host for test purposes.

func NewMockHost

func NewMockHost() *MockHost

NewMockHost returns a new instance of MockHost with proper defaults for most tests.

func (*MockHost) Context added in v0.2.2

func (mh *MockHost) Context() context.Context

Context returns a context provided by the host to be used on the component operations.

func (*MockHost) ReportFatalError

func (mh *MockHost) ReportFatalError(err error)

ReportFatalError is used to report to the host that the extension encountered a fatal error (i.e.: an error that the instance can't recover from) after its start function has already returned.

func (*MockHost) WaitForFatalError

func (mh *MockHost) WaitForFatalError(timeout time.Duration) (receivedError bool, err error)

WaitForFatalError waits the given amount of time until an error is reported via ReportFatalError. It returns the error, if any, and a bool to indicated if an error was received before the time out.

Jump to

Keyboard shortcuts

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