package testutil
import "google.golang.org/grpc/credentials/alts/internal/testutil"
Package testutil include useful test utilities for the handshaker.
Index ¶
- func MakeFrame(pl string) []byte
- func NewTestConn(in *bytes.Buffer, out *bytes.Buffer) net.Conn
- func NewTestConnWithReadLatency(in *bytes.Buffer, out *bytes.Buffer, readLatency time.Duration) net.Conn
- func NewUnresponsiveTestConn() net.Conn
- type FakeHandshaker
- type Stats
Functions ¶
func MakeFrame ¶
MakeFrame creates a handshake frame.
func NewTestConn ¶
NewTestConn creates a new instance of testConn object.
func NewTestConnWithReadLatency ¶
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 ¶
NewUnresponsiveTestConn creates a new instance of unresponsiveTestConn object.
Types ¶
type FakeHandshaker ¶
type FakeHandshaker struct { altsgrpc.HandshakerServiceServer }
FakeHandshaker is a fake implementation of the ALTS handshaker service.
func (*FakeHandshaker) DoHandshake ¶
func (h *FakeHandshaker) DoHandshake(stream altsgrpc.HandshakerService_DoHandshakeServer) error
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.
Source Files ¶
testutil.go
- Version
- v1.70.0 (latest)
- Published
- Jan 23, 2025
- Platform
- linux/amd64
- Imports
- 10 packages
- Last checked
- 19 hours ago –
Tools for package owners.