reflection

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsCleanup

func IsCleanup(typ reflect.Type) bool

IsCleanup checks that typ have cleanup signature.

func IsError

func IsError(typ reflect.Type) bool

IsError checks that typ have error signature.

Types

type CallResult

type CallResult []reflect.Value

CallResult is a helper struct for reflect.Call.

func (CallResult) Cleanup

func (r CallResult) Cleanup() func()

Cleanup returns cleanup function.

func (CallResult) Error

func (r CallResult) Error(position int) error

Error returns error if it exists.

func (CallResult) Result

func (r CallResult) Result() reflect.Value

Result returns first result type.

type Func

type Func struct {
	Name string
	reflect.Type
	reflect.Value
}

Func is a function description.

func InspectFunc

func InspectFunc(fn interface{}) (Func, bool)

InspectFunc inspects function.

type Interface

type Interface struct {
	Name string
	Type reflect.Type
}

Interface is a interface description.

func InspectInterfacePtr

func InspectInterfacePtr(iface interface{}) (*Interface, error)

InspectInterfacePtr inspects interface pointer.

Jump to

Keyboard shortcuts

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