eventtest

package
v0.0.0-...-b6f9f64 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package eventtest provides test types that are used to monitor client state and actions via the various monitor types supported by the driver.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestPoolMonitor

type TestPoolMonitor struct {
	*event.PoolMonitor
	// contains filtered or unexported fields
}

TestPoolMonitor exposes an *event.TestPoolMonitor and collects all events logged to that *event.TestPoolMonitor. It is safe to use from multiple concurrent goroutines.

func NewTestPoolMonitor

func NewTestPoolMonitor() *TestPoolMonitor

func (*TestPoolMonitor) ClearEvents

func (tpm *TestPoolMonitor) ClearEvents()

ClearEvents will reset the events collected by the testPoolMonitor.

func (*TestPoolMonitor) Events

func (tpm *TestPoolMonitor) Events(filters ...func(*event.PoolEvent) bool) []*event.PoolEvent

Events returns a copy of the events collected by the testPoolMonitor. Filters can optionally be applied to the returned events set and are applied using AND logic (i.e. all filters must return true to include the event in the result).

func (*TestPoolMonitor) IsPoolCleared

func (tpm *TestPoolMonitor) IsPoolCleared() bool

IsPoolCleared returns true if there are any events of type "event.PoolCleared" in the events recorded by the testPoolMonitor.

Jump to

Keyboard shortcuts

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