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.
Click to show internal directories.
Click to hide internal directories.