grpctest

package
v0.0.0-...-c9f981a Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client wraps a gRPC client connection

func NewClient

func NewClient(_ testing.TB, url string) *Client

NewClient connects to a gRPC server and creates the reflex client

func (*Client) Close

func (cl *Client) Close() error

Close ends the stream

func (*Client) StreamEvents

func (cl *Client) StreamEvents(ctx context.Context, after string,
	opts ...reflex.StreamOption,
) (reflex.StreamClient, error)

StreamEvents wraps a gRPC stream, feeding the events to reflex

type Server

type Server struct {
	reflexpb.UnimplementedReflexServer
	// contains filtered or unexported fields
}

Server is an gRPC streaming server for testing

func NewServer

func NewServer(_ testing.TB, stream reflex.StreamFunc,
	cStore reflex.CursorStore,
) (*Server, string)

NewServer starts and returns a reflex server and its address.

func (*Server) SentCount

func (srv *Server) SentCount() float64

SentCount is the number of events sent

func (*Server) Stop

func (srv *Server) Stop()

Stop ends any streams and stops the gRPC server

func (*Server) Stream

Stream creates a new stream

Jump to

Keyboard shortcuts

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