Documentation
¶
Overview ¶
Package rcprotocoltestimpl implements the rcprotocoltest component.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunTransportTests ¶
func RunTransportTests(ctx context.Context, httpClient *api.HTTPClient, runCount uint64)
RunTransportTests performs a pre-flight HTTP check and then runs the echo test over each supported transport protocol (WebSocket, gRPC, TCP).
Each transport test is independent — a failure in one does not prevent the others from running.
Types ¶
type GrpcPingPonger ¶
type GrpcPingPonger struct {
// contains filtered or unexported fields
}
GrpcPingPonger implements PingPonger using the RcEcho gRPC service.
func NewGrpcPingPonger ¶
func NewGrpcPingPonger(ctx context.Context, httpClient *api.HTTPClient, runCount uint64) (*GrpcPingPonger, error)
NewGrpcPingPonger connects to the RC gRPC echo endpoint and returns a GrpcPingPonger ready to exchange frames.
func (*GrpcPingPonger) GracefulClose ¶
func (g *GrpcPingPonger) GracefulClose()
GracefulClose cancels any in-flight RPCs and closes the underlying gRPC connection.
type PingPonger ¶
type PingPonger interface {
Recv(ctx context.Context) ([]byte, error)
Send(ctx context.Context, data []byte) error
GracefulClose()
}
PingPonger is a bidirectional echo interface satisfied by each transport protocol (WebSocket, gRPC, TCP).
type Provides ¶
type Provides struct {
compdef.Out
Comp rcprotocoltest.Component
}
Provides defines the output of the rcprotocoltest component.
type TCPPingPonger ¶
type TCPPingPonger struct {
// contains filtered or unexported fields
}
TCPPingPonger performs a ping/pong test by satisfying the PingPonger interface using a raw TCP connection and length-prefixed framing.
Frame structure:
[length prefix][payload ...]
Where `length prefix` is a u16 (2 byte, unsigned) which specifies the length of payload in bytes. Length values are little endian.
func NewTCPPingPonger ¶
func NewTCPPingPonger(ctx context.Context, httpClient *api.HTTPClient) (*TCPPingPonger, error)
NewTCPPingPonger connects to the RC TCP echo endpoint and returns a TCPPingPonger ready to exchange frames.
func (*TCPPingPonger) GracefulClose ¶
func (g *TCPPingPonger) GracefulClose()
GracefulClose closes the underlying TCP connection.