testutil

package
v1.63.0 Latest Latest
Warning

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

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

Documentation

Overview

Package testutil include useful test utilities for the handshaker.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeFrame

func MakeFrame(pl string) []byte

MakeFrame creates a handshake frame.

func NewTestConn

func NewTestConn(in *bytes.Buffer, out *bytes.Buffer) net.Conn

NewTestConn creates a new instance of testConn object.

func NewTestConnWithReadLatency added in v1.61.0

func NewTestConnWithReadLatency(in *bytes.Buffer, out *bytes.Buffer, readLatency time.Duration) net.Conn

NewTestConnWithReadLatency creates a new instance of testConn object that pauses for readLatency before any call to Read() returns.

func NewUnresponsiveTestConn

func NewUnresponsiveTestConn() net.Conn

NewUnresponsiveTestConn creates a new instance of unresponsiveTestConn object.

Types

type FakeHandshaker added in v1.55.0

type FakeHandshaker struct {
	altsgrpc.HandshakerServiceServer
}

FakeHandshaker is a fake implementation of the ALTS handshaker service.

func (*FakeHandshaker) DoHandshake added in v1.55.0

DoHandshake performs a fake ALTS handshake.

type Stats

type Stats struct {
	MaxConcurrentCalls int
	// contains filtered or unexported fields
}

Stats is used to collect statistics about concurrent handshake calls.

func (*Stats) Reset

func (s *Stats) Reset()

Reset resets the statistics.

func (*Stats) Update

func (s *Stats) Update() func()

Update updates the statistics by adding one call.

Jump to

Keyboard shortcuts

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