reflectx

package
v2.0.0-beta2 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2022 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StructToMap

func StructToMap(value interface{}) map[string]interface{}

StructToMap shallow convert struct to map, using field name as key, field value as map value. The Field name can be overridden using 'name' struct tag.

Note: only exported fields are set into map.

Types

type CallerInfo

type CallerInfo struct {
	Package  string // Package Name
	File     string // File Name
	Function string // Function Name
	LineNo   int    // Line number
}

CallerInfo is caller info

func GetCaller

func GetCaller(depth int) *CallerInfo

GetCaller return the caller info, param depth indicate the stack depth to the caller; for direct caller, depth is 1

Jump to

Keyboard shortcuts

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