emittest

package
v0.99.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Nop

func Nop(_ context.Context, _ []byte, _ map[string]any) error

Types

type Call added in v0.95.0

type Call struct {
	Token []byte
	Attrs map[string]any
}

type Sink

type Sink struct {
	emit.Callback
	// contains filtered or unexported fields
}

func NewSink

func NewSink(opts ...SinkOpt) *Sink

func (*Sink) ExpectCall

func (s *Sink) ExpectCall(t *testing.T, expected []byte, attrs map[string]any)

func (*Sink) ExpectCalls added in v0.95.0

func (s *Sink) ExpectCalls(t *testing.T, expected ...*Call)

func (*Sink) ExpectNoCalls

func (s *Sink) ExpectNoCalls(t *testing.T)

func (*Sink) ExpectNoCallsUntil

func (s *Sink) ExpectNoCallsUntil(t *testing.T, d time.Duration)

func (*Sink) ExpectToken

func (s *Sink) ExpectToken(t *testing.T, expected []byte)

func (*Sink) ExpectTokens

func (s *Sink) ExpectTokens(t *testing.T, expected ...[]byte)

func (*Sink) NextCall

func (s *Sink) NextCall(t *testing.T) ([]byte, map[string]any)

func (*Sink) NextToken

func (s *Sink) NextToken(t *testing.T) []byte

func (*Sink) NextTokens

func (s *Sink) NextTokens(t *testing.T, n int) [][]byte

type SinkOpt

type SinkOpt func(*sinkCfg)

func WithCallBuffer

func WithCallBuffer(n int) SinkOpt

func WithTimeout

func WithTimeout(d time.Duration) SinkOpt

Jump to

Keyboard shortcuts

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