Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
// GetBufferPool retrieves a buffer from the pool, creating one if necessary.
GetBufferPool = _pool.Get
)
Functions ¶
Types ¶
type Formatter ¶
type Formatter struct {
// contains filtered or unexported fields
}
Formatter formats a stack trace into a readable string representation.
func NewFormatter ¶
NewFormatter builds a new Formatter.
func (*Formatter) FormatFrame ¶
FormatFrame formats the given frame.
func (*Formatter) FormatStack ¶
FormatStack formats all remaining frames in the provided stacktrace -- minus the final runtime.main/runtime.goexit frame.
type Pool ¶
type Pool[T any] struct { // contains filtered or unexported fields }
A Pool is a generic wrapper around sync.Pool to provide strongly-typed object pooling.
Note that SA6002 (ref: https://staticcheck.io/docs/checks/#SA6002) will not be detected, so all internal pool use must take care to only store pointer types.
func NewPool ¶
NewPool returns a new Pool for T, and will use fn to construct new Ts when the pool is empty.
type Stack ¶
type Stack struct {
// contains filtered or unexported fields
}
Stack is a captured stack trace.
func Capture ¶
Capture captures a stack trace of the specified depth, skipping the provided number of frames. skip=0 identifies the caller of Capture.
The caller must call Free on the returned stacktrace after using it.
func (*Stack) Count ¶
Count reports the total number of frames in this stacktrace. Count DOES NOT change as Next is called.