Involved Source Files Package testing provides testing helpers for state machines using testify.
Package-Level Type Names (only one)
/* sort by: | */
MeteredUDP wraps a net.PacketConn to track bytes and packet counts.PacketConnnet.PacketConn Stats getters(*MeteredUDP) BytesOut() uint64 Close closes the connection.
Any blocked ReadFrom or WriteTo operations will be unblocked and return errors. LocalAddr returns the local network address, if known.(*MeteredUDP) PacketsIn() uint64(*MeteredUDP) PacketsOut() uint64(*MeteredUDP) ReadFrom(p []byte) (int, net.Addr, error) SetDeadline sets the read and write deadlines associated
with the connection. It is equivalent to calling both
SetReadDeadline and SetWriteDeadline.
A deadline is an absolute time after which I/O operations
fail instead of blocking. The deadline applies to all future
and pending I/O, not just the immediately following call to
Read or Write. After a deadline has been exceeded, the
connection can be refreshed by setting a deadline in the future.
If the deadline is exceeded a call to Read or Write or to other
I/O methods will return an error that wraps os.ErrDeadlineExceeded.
This can be tested using errors.Is(err, os.ErrDeadlineExceeded).
The error's Timeout method will return true, but note that there
are other possible errors for which the Timeout method will
return true even if the deadline has not been exceeded.
An idle timeout can be implemented by repeatedly extending
the deadline after successful ReadFrom or WriteTo calls.
A zero value for t means I/O operations will not time out. SetReadDeadline sets the deadline for future ReadFrom calls
and any currently-blocked ReadFrom call.
A zero value for t means ReadFrom will not time out. SetWriteDeadline sets the deadline for future WriteTo calls
and any currently-blocked WriteTo call.
Even if write times out, it may return n > 0, indicating that
some of the data was successfully written.
A zero value for t means WriteTo will not time out.(*MeteredUDP) WriteTo(p []byte, addr net.Addr) (int, error)
MeteredUDP : github.com/pion/datachannel.ReadDeadliner
MeteredUDP : github.com/pion/datachannel.WriteDeadliner
MeteredUDP : github.com/prometheus/common/expfmt.Closer
MeteredUDP : io.Closer
*MeteredUDP : net.PacketConn
func WrapUDP(conn net.PacketConn) *MeteredUDP
Package-Level Functions (total 19)
AssertErr asserts that the machine is in the Exception state.
AssertIs asserts that the machine is in the given states.
AssertIs1 asserts that the machine is in the given state.
AssertNoErrEver asserts that the machine never was in the Exception state.
AssertNoErrNow asserts that the machine is not in the Exception state.
The pages are generated with Goldsv0.8.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.