Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Frame ¶
Frame represents a single stack frame with debugging information. This struct contains information about a function call location, including the file, line number, function name, and program counter.
func NewFrameFromCaller ¶
NewFrameFromCaller creates a new Frame from the current call stack. This function walks up the call stack to find the first frame that is not in the do package or Go runtime, providing useful debugging information about where a service was invoked from.
The function filters out:
- Frames in the Go runtime (GOROOT)
- Frames in the do package (except examples and tests)
- Frames in the stacktrace package
Returns a Frame representing the caller and a boolean indicating success. The boolean is false if no suitable frame was found.
This function is used internally by the DI container to track service invocation locations for debugging and explanation purposes.
func NewFrameFromPC ¶
NewFrameFromPC creates a new Frame from a program counter (PC) value. This function is used to create Frame objects from function pointers, typically for tracking where service providers were defined.
Parameters:
- pc: The program counter value representing a function
Returns a Frame representing the function and a boolean indicating success. The boolean is false if the PC value is invalid.
This function is used internally to track service provider locations for debugging and explanation purposes.