Documentation
¶
Overview ¶
Package wiregolden renders the client requests of a capture as a normalized transcript, so that libfdb_c's and the Go client's requests for the same deterministic scenario can be compared line by line.
A scenario starts with a read of MarkerPrefix+name, so the transcript splits by scenario the same way for both clients; a marker named "~end" closes the last one. Within a scenario, requests are in the order they became readable at the capture point. What differs between runs is normalized, keeping equality: versions become V1, V2, ... and random byte strings (the 16 bytes of a self-conflicting key, idempotency IDs) become R1, R2, ... in order of appearance within the scenario. Reply tokens, span and debug IDs are left out. In key fields, the scenario's key prefix is written <p>; values are literal.
Index ¶
Constants ¶
const MarkerPrefix = "\x02wg/marker/"
MarkerPrefix is the key a scenario's marker read gets, followed by its name.
Variables ¶
This section is empty.
Functions ¶
func Transcript ¶
Transcript renders the requests of each scenario. Requests before the first marker (setup) and after the ~end marker are left out. It fails unless the markers are exactly want followed by ~end, on a scenario without a request, and on a request inside a scenario that the transcript does not decode (its fields would not be compared).
Types ¶
type Capture ¶
type Capture struct {
Requests []Request
// Other counts client frames of file identifiers the transcript does not
// decode. They appear in the transcript as FileID(n), without fields.
Other map[uint32]int
// Undecodable counts frames of a decoded type that failed to parse.
Undecodable int
Complete bool
}
Capture is a decoded capture.
func DecodeWireLog ¶
DecodeWireLog decodes the sends of a binary wire log (transport.CaptureWireLog): the client's requests, in the order it sent them.