runtimecaller

package
v0.0.0-...-c6ea6ab Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2021 License: LGPL-3.0 Imports: 3 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

FilterCommons contains all common filters

Functions

func FilterOnlyGoSource

func FilterOnlyGoSource(callinfo CallInfo) (valid bool, stop bool)

FilterOnlyGoSource filter CallInfo FileName end with ".go"

func FilterStopRuntimeCallerPackage

func FilterStopRuntimeCallerPackage(callinfo CallInfo) (valid bool, stop bool)

FilterStopRuntimeCallerPackage filter CallInfo to stop after reach KDGoLib/runtimecaller package

Types

type CallInfo

type CallInfo interface {
	// builtin data
	PC() uintptr
	FilePath() string
	Line() int

	// extra info after some process
	PCFunc() *runtime.Func
	PackageName() string
	FileDir() string
	FileName() string
	FuncName() string
}

CallInfo contains runtime caller information

func GetByFilters

func GetByFilters(skip int, filters ...Filter) (callinfo CallInfo, ok bool)

GetByFilters return CallInfo until all filters are valid

func ListByFilters

func ListByFilters(skip int, filters ...Filter) (callinfos []CallInfo)

ListByFilters return all CallInfo stack for all filters are valid

type CallInfoImpl

type CallInfoImpl struct {
	// contains filtered or unexported fields
}

CallInfoImpl implement CallInfo

func (CallInfoImpl) FileDir

func (t CallInfoImpl) FileDir() string

FileDir return CallInfo data

func (CallInfoImpl) FileName

func (t CallInfoImpl) FileName() string

FileName return CallInfo data

func (CallInfoImpl) FilePath

func (t CallInfoImpl) FilePath() string

FilePath return CallInfo data

func (CallInfoImpl) FuncName

func (t CallInfoImpl) FuncName() string

FuncName return CallInfo data

func (CallInfoImpl) Line

func (t CallInfoImpl) Line() int

Line return CallInfo data

func (CallInfoImpl) PC

func (t CallInfoImpl) PC() uintptr

PC return CallInfo data

func (CallInfoImpl) PCFunc

func (t CallInfoImpl) PCFunc() *runtime.Func

PCFunc return CallInfo data

func (CallInfoImpl) PackageName

func (t CallInfoImpl) PackageName() string

PackageName return CallInfo data

type Filter

type Filter func(callinfo CallInfo) (valid bool, stop bool)

Filter use to filter runtime.Caller result

Jump to

Keyboard shortcuts

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