trace

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package trace keeps what crossed a service's edge during a run, as the records flows/1 is written from. A stack's adapter records its transports through it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Begin

func Begin() int64

Begin takes the next place in the order, for a call that writes its record once it returns.

func Case

func Case(uri string)

Case names the file of the scenario about to run.

func Enable

func Enable(svc string)

Enable starts keeping records for the suite of svc.

func Event

func Event(dir, key string, body []byte)

Event records a message: "in" for a delivery, "out" for a publication.

func On

func On() bool

On is whether records are being kept.

func Raw

func Raw(body []byte) json.RawMessage

Raw is body as a record holds it: JSON as it is, anything else quoted.

func Start

func Start(t interface{ Name() string })

A suite runs its scenarios one after another, so the one being booted is the one every record belongs to until the next boot.

func Step

func Step(kind string)

Step marks what the scenario's current step is for. Start leaves it alone: a scenario boots inside its first step.

func Write

func Write(r Record)

Write keeps r under the scenario and step on now, in its place or the next one.

Types

type Record

type Record struct {
	// A call is written once it returns, after whatever it sent on the way, so
	// the order it began in is kept here.
	Seq      int64
	Service  string
	Scenario string
	Feature  string // the file the scenario is in, as the suite named it
	Step     string // Context, Action or Outcome: Given, When, Then
	Dir      string // in, out
	Kind     string // grpc, event, http, command
	Name     string // the full method, the routing key, the route or the command
	Request  json.RawMessage
	Response json.RawMessage
	Error    string // the refusal by code and failure type
}

func Records

func Records() []Record

Records is everything kept so far, in the order it was written.

Jump to

Keyboard shortcuts

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