reflect

package
v0.0.0-...-fab57c2 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package reflect provides a mockable wrapper for reflect.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Impl

type Impl struct{}

func (*Impl) Append

func (*Impl) Append(s reflect.Value, x ...reflect.Value) reflect.Value

func (*Impl) AppendSlice

func (*Impl) AppendSlice(s reflect.Value, t reflect.Value) reflect.Value

func (*Impl) ArrayOf

func (*Impl) ArrayOf(length int, elem reflect.Type) reflect.Type

func (*Impl) ChanOf

func (*Impl) ChanOf(dir reflect.ChanDir, t reflect.Type) reflect.Type

func (*Impl) Copy

func (*Impl) Copy(dst reflect.Value, src reflect.Value) int

func (*Impl) DeepEqual

func (*Impl) DeepEqual(x any, y any) bool

func (*Impl) FuncOf

func (*Impl) FuncOf(in []reflect.Type, out []reflect.Type, variadic bool) reflect.Type

func (*Impl) Indirect

func (*Impl) Indirect(v reflect.Value) reflect.Value

func (*Impl) MakeChan

func (*Impl) MakeChan(typ reflect.Type, buffer int) reflect.Value

func (*Impl) MakeFunc

func (*Impl) MakeFunc(typ reflect.Type, fn func(args []reflect.Value) (results []reflect.Value)) reflect.Value

func (*Impl) MakeMap

func (*Impl) MakeMap(typ reflect.Type) reflect.Value

func (*Impl) MakeMapWithSize

func (*Impl) MakeMapWithSize(typ reflect.Type, n int) reflect.Value

func (*Impl) MakeSlice

func (*Impl) MakeSlice(typ reflect.Type, len int, cap int) reflect.Value

func (*Impl) MapOf

func (*Impl) MapOf(key reflect.Type, elem reflect.Type) reflect.Type

func (*Impl) New

func (*Impl) New(typ reflect.Type) reflect.Value

func (*Impl) NewAt

func (*Impl) NewAt(typ reflect.Type, p unsafe.Pointer) reflect.Value

func (*Impl) PointerTo

func (*Impl) PointerTo(t reflect.Type) reflect.Type

func (*Impl) PtrTo

func (*Impl) PtrTo(t reflect.Type) reflect.Type

func (*Impl) Select

func (*Impl) Select(cases []reflect.SelectCase) (chosen int, recv reflect.Value, recvOK bool)

func (*Impl) SliceOf

func (*Impl) SliceOf(t reflect.Type) reflect.Type

func (*Impl) StructOf

func (*Impl) StructOf(fields []reflect.StructField) reflect.Type

func (*Impl) Swapper

func (*Impl) Swapper(slice any) func(i int, j int)

func (*Impl) TypeOf

func (*Impl) TypeOf(i any) reflect.Type

func (*Impl) ValueOf

func (*Impl) ValueOf(i any) reflect.Value

func (*Impl) VisibleFields

func (*Impl) VisibleFields(t reflect.Type) []reflect.StructField

func (*Impl) Zero

func (*Impl) Zero(typ reflect.Type) reflect.Value

type Interface

type Interface interface {
	Append(s reflect.Value, x ...reflect.Value) reflect.Value
	AppendSlice(s reflect.Value, t reflect.Value) reflect.Value
	ArrayOf(length int, elem reflect.Type) reflect.Type
	ChanOf(dir reflect.ChanDir, t reflect.Type) reflect.Type
	Copy(dst reflect.Value, src reflect.Value) int
	DeepEqual(x any, y any) bool
	FuncOf(in []reflect.Type, out []reflect.Type, variadic bool) reflect.Type
	Indirect(v reflect.Value) reflect.Value
	MakeChan(typ reflect.Type, buffer int) reflect.Value
	MakeFunc(typ reflect.Type, fn func(args []reflect.Value) (results []reflect.Value)) reflect.Value
	MakeMap(typ reflect.Type) reflect.Value
	MakeMapWithSize(typ reflect.Type, n int) reflect.Value
	MakeSlice(typ reflect.Type, len int, cap int) reflect.Value
	MapOf(key reflect.Type, elem reflect.Type) reflect.Type
	New(typ reflect.Type) reflect.Value
	NewAt(typ reflect.Type, p unsafe.Pointer) reflect.Value
	PointerTo(t reflect.Type) reflect.Type
	PtrTo(t reflect.Type) reflect.Type
	Select(cases []reflect.SelectCase) (chosen int, recv reflect.Value, recvOK bool)
	SliceOf(t reflect.Type) reflect.Type
	StructOf(fields []reflect.StructField) reflect.Type
	Swapper(slice any) func(i int, j int)
	TypeOf(i any) reflect.Type
	ValueOf(i any) reflect.Value
	VisibleFields(t reflect.Type) []reflect.StructField
	Zero(typ reflect.Type) reflect.Value
}

Jump to

Keyboard shortcuts

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