xray

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2019 License: Apache-2.0 Imports: 5 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

go-xray

Go Report Card Documentation license GitHub version GitHub issues

This is a Golang library with reflection related functions which I use in my different projects.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Name added in v1.0.2

func Name(obj interface{}) string

Name returns the name of an object

func Properties

func Properties(obj interface{}) ([]string, error)

Properties returns the struct fields names list. obj can whether be a structure or pointer to structure.

func PropertiesAsMap

func PropertiesAsMap(obj interface{}) (map[string]interface{}, error)

PropertiesAsMap returns the properties of an item as a map

func Property

func Property(obj interface{}, fieldName string) (interface{}, error)

Property returns the specific property of obj

func Tags

func Tags(obj interface{}, tagname string) (map[string]string, error)

Tags lists the struct tag fields. obj can whether be a structure or pointer to structure.

Types

type KeyValue

type KeyValue struct {
	Key   string
	Value interface{}
}

KeyValue abstracts key with a value

func (*KeyValue) String

func (kv *KeyValue) String() string

String returns the key value pair in the form <key>=<value>

Jump to

Keyboard shortcuts

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