reflect

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: Apache-2.0, BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// BoolType is the reflect.Type of bool.
	BoolType = reflect.TypeOf(true)
	// TimeDurationType is the reflect.Type of time.Duration.
	TimeDurationType = reflect.TypeOf(time.Duration(0))
	// Float32Type is the reflect.Type of float32.
	Float32Type = reflect.TypeOf(float32(0))
	// Float64Type is the reflect.Type of float64.
	Float64Type = reflect.TypeOf(float64(0))
	// IntType is the reflect.Type of int.
	IntType = reflect.TypeOf(int(0))
	// Int8Type is the reflect.Type of int8.
	Int8Type = reflect.TypeOf(int8(0))
	// Int16Type is the reflect.Type of int16.
	Int16Type = reflect.TypeOf(int16(0))
	// Int32Type is the reflect.Type of int32.
	Int32Type = reflect.TypeOf(int32(0))
	// Int64Type is the reflect.Type of int64.
	Int64Type = reflect.TypeOf(int64(0))
	// StringType is the reflect.Type of string.
	StringType = reflect.TypeOf("")
	// UintType is the reflect.Type of uint.
	UintType = reflect.TypeOf(uint(0))
	// Uint8Type is the reflect.Type of uint8.
	Uint8Type = reflect.TypeOf(uint8(0))
	// Uint16Type is the reflect.Type of uint16.
	Uint16Type = reflect.TypeOf(uint16(0))
	// Uint32Type is the reflect.Type of uint32.
	Uint32Type = reflect.TypeOf(uint32(0))
	// Uint64Type is the reflect.Type of uint64.
	Uint64Type = reflect.TypeOf(uint64(0))
	// StringSliceType is the reflect.Type of []string.
	StringSliceType = reflect.TypeOf([]string{})
	// StringMapType is the reflect.Type of map[string]string.
	StringMapType = reflect.TypeOf(map[string]string{})
)

Functions

func FuncPostCallback

func FuncPostCallback(fnc interface{}, callback func()) interface{}

FuncPostCallback returns an interface to a function that calls 'callback' after calling 'fnc'.

func FuncPreCallback

func FuncPreCallback(fnc interface{}, callback func()) interface{}

FuncPreCallback returns an interface to a function that calls 'callback' before calling 'fnc'.

func GetCaller

func GetCaller(skipFrames int) runtime.Frame

Types

type CallStack

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

func GetExternalCallers

func GetExternalCallers(packageName string, skipCallers int) (callers *CallStack)

func (*CallStack) ExternalEntryPoint

func (callStack *CallStack) ExternalEntryPoint() string

func (*CallStack) String

func (callStack *CallStack) String() string

type Callers

type Callers []runtime.Frame

func GetCallers

func GetCallers(skipCallers int) (callers Callers)

func (Callers) Skip

func (callers Callers) Skip(n int) Callers

func (Callers) String

func (callers Callers) String() string

Jump to

Keyboard shortcuts

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