reflect

package
v0.0.0-...-984a488 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2019 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Swapper

func Swapper(slice interface{}) func(i, j int)

Types

type Kind

type Kind uintptr

A Kind is the number that the compiler uses for this type.

Not used directly. These types are all replaced with the number the compiler uses internally for the type.

const (
	Invalid Kind = iota
	Bool
	Int
	Int8
	Int16
	Int32
	Int64
	Uint
	Uint8
	Uint16
	Uint32
	Uint64
	Uintptr
	Float32
	Float64
	Complex64
	Complex128
	Array
	Chan
	Func
	Interface
	Map
	Ptr
	Slice
	String
	Struct
	UnsafePointer
)

Copied from reflect/type.go https://golang.org/src/reflect/type.go?s=8302:8316#L217

type StructField

type StructField struct {
	Name string
	Type Type
}

type Type

type Type uintptr

The typecode as used in an interface{}.

func TypeOf

func TypeOf(i interface{}) Type

func (Type) Bits

func (t Type) Bits() int

func (Type) Elem

func (t Type) Elem() Type

func (Type) Field

func (t Type) Field(i int) StructField

func (Type) Kind

func (t Type) Kind() Kind

func (Type) Len

func (t Type) Len() int

func (Type) NumField

func (t Type) NumField() int

func (Type) Size

func (t Type) Size() uintptr

func (Type) String

func (t Type) String() string

type Value

type Value struct {
	// contains filtered or unexported fields
}

This is the same thing as an interface{}.

func Indirect

func Indirect(v Value) Value

func MakeSlice

func MakeSlice(typ Type, len, cap int) Value

func ValueOf

func ValueOf(i interface{}) Value

func (Value) Addr

func (v Value) Addr() Value

func (Value) Bool

func (v Value) Bool() bool

func (Value) Bytes

func (v Value) Bytes() []byte

func (Value) CanAddr

func (v Value) CanAddr() bool

func (Value) CanInterface

func (v Value) CanInterface() bool

func (Value) CanSet

func (v Value) CanSet() bool

func (Value) Complex

func (v Value) Complex() complex128

func (Value) Elem

func (v Value) Elem() Value

func (Value) Field

func (v Value) Field(i int) Value

func (Value) Float

func (v Value) Float() float64

func (Value) Index

func (v Value) Index(i int) Value

func (Value) Int

func (v Value) Int() int64

func (Value) Interface

func (v Value) Interface() interface{}

func (Value) IsNil

func (v Value) IsNil() bool

func (Value) IsValid

func (v Value) IsValid() bool

func (Value) Kind

func (v Value) Kind() Kind

func (Value) Len

func (v Value) Len() int

func (Value) MapIndex

func (v Value) MapIndex(key Value) Value

func (Value) MapKeys

func (v Value) MapKeys() []Value

func (Value) NumField

func (v Value) NumField() int

func (Value) Pointer

func (v Value) Pointer() uintptr

func (Value) Set

func (v Value) Set(x Value)

func (Value) SetBool

func (v Value) SetBool(x bool)

func (Value) SetComplex

func (v Value) SetComplex(x complex128)

func (Value) SetFloat

func (v Value) SetFloat(x float64)

func (Value) SetInt

func (v Value) SetInt(x int64)

func (Value) SetString

func (v Value) SetString(x string)

func (Value) SetUint

func (v Value) SetUint(x uint64)

func (Value) Slice

func (v Value) Slice(i, j int) Value

func (Value) String

func (v Value) String() string

func (Value) Type

func (v Value) Type() Type

func (Value) Uint

func (v Value) Uint() uint64

Jump to

Keyboard shortcuts

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