debug

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 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 (
	CallDirectionInbound  CallDirection = "inbound"
	CallDirectionOutbound CallDirection = "outbound"

	CallResultSuccess CallResult = "success"
	CallResultFailure CallResult = "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 CallDirection

type CallDirection string

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

type CallResult

type CallResult string

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

type DebuggedCall

type DebuggedCall 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 CallDirection,
		startTime time.Time,
		endTime time.Time,
		result CallResult,
		failureCause string,
	)
	// Finalise finalises the call and makes it ready for storage.
	Finalise()
}

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

func NewNoopCall

func NewNoopCall() DebuggedCall

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

type Debugger

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

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

func NewDummy

func NewDummy(returnedCall DebuggedCall) 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.

Jump to

Keyboard shortcuts

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