streamtest

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package streamtest provides utilities for stream testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustParse

func MustParse(filename string) []stream.Message

MustParse parses a json file with messages and returns them. It panics if the file cannot be parsed.

Types

type MockProcessor

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

MockProcessor mocks a stream processor with a predefined set of messages. It implements the interface stream.Processor.

func NewMockProcessor

func NewMockProcessor(msgs []stream.Message) *MockProcessor

NewMockProcessor returns a MockProcessor. It initializes its internal list of messages with msgs.

func (*MockProcessor) Process

func (mp *MockProcessor) Process(ctx context.Context, entity string, h stream.MsgHandler) error

Process processes the messages passed to NewMockProcessor.

Jump to

Keyboard shortcuts

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