clitesting

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package clitesting contains utilities useful for testing clients and client components.

Index

Constants

View Source
const (
	// MockCommTimeout is how long we wait for the test to accept messages
	// sent through MockServiceContext.
	MockCommTimeout = 5 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MockServiceContext

type MockServiceContext struct {
	service.Context

	OutChan        chan *fspb.Message
	StatsCollector stats.Collector
}

MockServiceContext is a mock service.Context which allows a test to run a service without a full Fleetspeak client.

func (*MockServiceContext) Send

Send implements service.Context by copying the message to sc.OutChan.

func (*MockServiceContext) Stats

func (sc *MockServiceContext) Stats() stats.Collector

Stats implements service.Context by returning the assigned stats.Collector or a NoopCollector if none was set.

Jump to

Keyboard shortcuts

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