test

package
v0.0.0-...-bd0cbf8 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0, MIT Imports: 6 Imported by: 0

Documentation

Overview

Package test provides functionality used to test the remote sink.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	// MsgType indicates what is the type of Msg.
	MsgType pb.MessageType
	// Msg is the payload to the message that can be decoded using MsgType.
	Msg []byte
}

Message corresponds to a single message sent from sinks.Remote.

type Server

type Server struct {
	server.CommonServer
	// contains filtered or unexported fields
}

Server is the counterpart to the sinks.Remote. It receives connections remote sink and stores all points that it receives.

func NewServer

func NewServer() (*Server, error)

NewServer creates a new server that listens to a UDS that it creates under os.TempDir.

func (*Server) Count

func (s *Server) Count() int

Count return the number of points it has received.

func (*Server) GetPoints

func (s *Server) GetPoints() []Message

GetPoints returns all points that it has received.

func (*Server) NewClient

func (s *Server) NewClient() (server.MessageHandler, error)

NewClient returns a new MessageHandler to process messages.

func (*Server) Reset

func (s *Server) Reset() int

Reset throws aways all points received so far and returns the number of points discarded.

func (*Server) SetVersion

func (s *Server) SetVersion(newVersion uint32)

SetVersion sets the version to be used in handshake.

func (*Server) WaitForCount

func (s *Server) WaitForCount(count int)

WaitForCount waits for the number of points to reach the desired number.

Jump to

Keyboard shortcuts

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