inspect

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2020 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultTagName is the default tag name for struct fields which provides
	// a more granular to tweak certain structs. Lookup the necessary functions
	// for more info.
	DefaultTagName = "structs" // struct's field default tag name
)

archived: https://github.com/fatih/structs

Functions

func AllKeys

func AllKeys(objsMapList []map[string]interface{}) []string

func AsInterfaces

func AsInterfaces(slice interface{}) []interface{}

func Contains

func Contains(s []string, str string) bool

func Dump

func Dump(obj interface{}) string

func DumpTable

func DumpTable(slice interface{}) string

func Map

func Map(s interface{}) map[string]interface{}

func PrintDump

func PrintDump(obj interface{})

func PrintDumpTable

func PrintDumpTable(objs interface{})

func Vars

func Vars(objs map[string]interface{})

Types

type Struct

type Struct struct {
	TagName string
	// contains filtered or unexported fields
}

func New

func New(s interface{}) *Struct

func (*Struct) FillMap

func (s *Struct) FillMap(out map[string]interface{})

func (*Struct) Map

func (s *Struct) Map() map[string]interface{}

type TableFilter

type TableFilter func(*tablewriter.Table)

type TableOptions

type TableOptions struct {
	Headers []string
	Writer  io.Writer
	Filter  TableFilter
}

func (TableOptions) DumpTable

func (options TableOptions) DumpTable(slice interface{}) string

func (TableOptions) PrintDumpTable

func (options TableOptions) PrintDumpTable(slice interface{})

Jump to

Keyboard shortcuts

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