callstack

package
v3.16.2 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FuncName

func FuncName(fn *runtime.Func) string

FuncName given a runtime function spec returns a short function name in format `<package name>.<function name>` or if the function has a receiver in format `<package name>.(<receiver>).<function name>`.

func GetCallStack

func GetCallStack(frames errors.StackTrace) string

func GoRoutineID

func GoRoutineID() uint64

GoRoutineID returns the current goroutine id.

Types

type CallStack

type CallStack []uintptr

CallStack represents a stack of program counters.

func New

func New(skip int) *CallStack

New creates a new CallStack struct from current stack minus 'skip' number of frames.

func (*CallStack) Format

func (cs *CallStack) Format(st fmt.State, verb rune)

func (*CallStack) StackTrace

func (cs *CallStack) StackTrace() errors.StackTrace

type FrameInfo

type FrameInfo struct {
	CallStack string
	Func      string
	File      string
	LineNo    int
}

func GetLastFrame

func GetLastFrame(frames errors.StackTrace) FrameInfo

GetLastFrame returns Caller information on the first frame in the stack trace.

type HasStackTrace

type HasStackTrace interface {
	StackTrace() errors.StackTrace
}

Jump to

Keyboard shortcuts

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