caller

package
v0.0.0-...-fa5f906 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 4 Imported by: 4

Documentation

Overview

Package caller provides packaging for system runtime.Caller

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Caller

type Caller struct {
	File File     `json:"file"`
	Func Function `json:"function"`
	Line int      `json:"line"`
}

Caller identifies a caller

func GetAllCallers

func GetAllCallers() (callers []Caller)

GetAllCallers get all caller infos

func GetCaller

func GetCaller(skip int) Caller

GetCaller get last caller. If skip is set to 0, will get yourself.

func (Caller) String

func (c Caller) String() string

String implements fmt.Stringer

type File

type File string

File identifies a full file path

func (File) Base

func (f File) Base() string

Base returns the base file name.

func (File) WithDir

func (f File) WithDir(max int) string

WithDir returns base file name with specified maximum directories.

type Function

type Function string

File identifies a full function path

func (Function) Base

func (f Function) Base() string

Base returns the full base of a function.

func (Function) Name

func (f Function) Name() string

Name returns the base function name.

func (Function) Package

func (f Function) Package() string

Package returns package name

Jump to

Keyboard shortcuts

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