debug

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: BSD-3-Clause Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DirectionInbound  Direction = "inbound"
	DirectionOutbound Direction = "outbound"

	ResultSuccess Result = "success"
	ResultFailure Result = "failure"

	// DebugContextKey is the context key used to store the debugged call in the context. DO NOT
	// use this key directly, use [composer.DebugContextKey] instead.
	DebugContextKey string = "krb.debug"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Call added in v1.9.1

type Call interface {
	// SetStartTime sets the start time of the call.
	SetStartTime(startTime time.Time)
	// SetURL sets the URL of the call.
	SetURL(url string)
	// SetMethod sets the HTTP method of the call.
	SetMethod(method string)
	// SetStatusCode sets the HTTP status code of the call.
	SetStatusCode(statusCode int)
	// AddTransition adds a flow transition to the call.
	AddTransition(
		component string,
		direction Direction,
		startTime time.Time,
		endTime time.Time,
		result Result,
		failureCause string,
	)
	// Finalise finalises the call and makes it ready for storage.
	Finalise()
}

Call is the interface that defines the methods for a debugged call.

func NoopCall added in v1.9.1

func NoopCall() Call

NoopCall returns a new instance of a DebuggedCall that does not perform any actual debugging.

type Debugger

type Debugger interface {
	// Debug starts a new debugged call and returns it along with a context that has the call stored in it.
	Debug(context.Context) (Call, context.Context)
}

Debugger is the interface that defines the methods for debugging calls.

func NewDummy

func NewDummy(returnedCall Call) Debugger

NewDummy returns a new instance of a dummy Debugger that does not perform any actual debugging. This is useful for testing or when debugging is not required.

type Direction added in v1.9.1

type Direction string

Direction represents the direction of a call, either inbound or outbound.

type Result added in v1.9.1

type Result string

Result represents the result of a call, either success or failure.

Jump to

Keyboard shortcuts

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