Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InterfaceType ¶
InterfaceType is a type for an interface
func Interface ¶
func Interface(t reflect.Type) (InterfaceType, error)
Interface will check that t is either an interface or an interface pointer. If it is an interface pointer, then the interface that is pointed to is returned. If it is not an interface, then an error is returned describing the actual type.
func ObjectInterface ¶
func ObjectInterface(ptr interface{}) (InterfaceType, error)
ObjectInterface returns the extracted interface for the object reference. Note: that o must be a pointer.
type PackagePath ¶
type PackagePath string
PackagePath represents a go package path
const NoPackage PackagePath = ""
NoPackage represents the "" package, which is for predeclared types and unnamed types
func ObjectPackage ¶
func ObjectPackage(o interface{}) PackagePath
ObjectPackage returns the package the the specified object belongs to It only supports named types or pointers to named types. If the type was predeclared (string, error) or unnamed (*T, struct{}, []int), then the package path will be the empty string.
func TypePackage ¶
func TypePackage(t reflect.Type) PackagePath
TypePackage returns the package path that the type belongs to If the type is a pointer, then it returns the package for the pointer's element type
type StructType ¶
StructType is a type for a struct